diff --git a/core/database/installer.go b/core/database/installer.go index ab3583f7..4beb0d22 100644 --- a/core/database/installer.go +++ b/core/database/installer.go @@ -39,6 +39,8 @@ func InstallUpgrade(runtime *env.Runtime, existingDB bool) (err error) { return } + runtime.Log.Info(fmt.Sprintf("Database: loaded %d SQL scripts for provider %s", len(dbTypeScripts), runtime.Storage.Type)) + // Get current database version. currentVersion := 0 if existingDB { @@ -63,7 +65,7 @@ func InstallUpgrade(runtime *env.Runtime, existingDB bool) (err error) { var err error amLeader, err = Lock(runtime, len(toProcess)) if err != nil { - runtime.Log.Error("unable to lock DB", err) + runtime.Log.Error("Database: failed to lock existing database for processing", err) } } else { // New installation hopes that you are only spinning up one instance of Documize. diff --git a/core/database/leader.go b/core/database/leader.go index 524030db..afeaeae2 100644 --- a/core/database/leader.go +++ b/core/database/leader.go @@ -43,12 +43,14 @@ func Lock(runtime *env.Runtime, scriptsToProcess int) (bool, error) { // Start transaction fotr lock process. tx, err := runtime.Db.Beginx() if err != nil { + runtime.Log.Error("Database: unable to start transaction", err) return false, err } // Lock the database. _, err = tx.Exec(processLockStartQuery(runtime.Storage.Type)) if err != nil { + runtime.Log.Error("Database: unable to lock tables", err) return false, err } @@ -83,7 +85,7 @@ func Unlock(runtime *env.Runtime, tx *sqlx.Tx, err error, amLeader bool) error { if tx != nil { if err == nil { tx.Commit() - runtime.Log.Info("Database: ready") + runtime.Log.Info("Database: is ready") return nil } tx.Rollback() diff --git a/domain/section/register.go b/domain/section/register.go index 04f3a4b9..427c3ba6 100644 --- a/domain/section/register.go +++ b/domain/section/register.go @@ -47,5 +47,5 @@ func Register(rt *env.Runtime, s *domain.Store) { provider.Register("flowchart", &flowchart.Provider{Runtime: rt, Store: s}) p := provider.List() - rt.Log.Info(fmt.Sprintf("Registered %d sections", len(p))) + rt.Log.Info(fmt.Sprintf("Extensions: registered %d section types", len(p))) } diff --git a/server/server.go b/server/server.go index 5f9f204b..0331197f 100644 --- a/server/server.go +++ b/server/server.go @@ -30,7 +30,7 @@ var testHost string // used during automated testing // Start router to handle all HTTP traffic. func Start(rt *env.Runtime, s *domain.Store, ready chan struct{}) { - rt.Log.Info(fmt.Sprintf("Starting %s version %s", rt.Product.Title, rt.Product.Version)) + rt.Log.Info(fmt.Sprintf("Edition: %s version %s", rt.Product.Title, rt.Product.Version)) // decide which mode to serve up switch rt.Flags.SiteMode { @@ -47,7 +47,7 @@ func Start(rt *env.Runtime, s *domain.Store, ready chan struct{}) { if err != nil { rt.Log.Error("plugin setup failed", err) } - rt.Log.Info("Starting web server") + rt.Log.Info("Web Server: starting up") } // define middleware @@ -88,7 +88,7 @@ func Start(rt *env.Runtime, s *domain.Store, ready chan struct{}) { // start server if !rt.Flags.SSLEnabled() { - rt.Log.Info("Starting non-SSL server on " + rt.Flags.HTTPPort) + rt.Log.Info("Web Server: binding non-SSL server on " + rt.Flags.HTTPPort) if rt.Flags.SiteMode == env.SiteModeSetup { rt.Log.Info("***") rt.Log.Info(fmt.Sprintf("*** Go to http://localhost:%s/setup in your web browser and complete setup wizard ***", rt.Flags.HTTPPort)) @@ -98,7 +98,7 @@ func Start(rt *env.Runtime, s *domain.Store, ready chan struct{}) { n.Run(testHost + ":" + rt.Flags.HTTPPort) } else { if rt.Flags.ForceHTTPPort2SSL != "" { - rt.Log.Info("Starting non-SSL server on " + rt.Flags.ForceHTTPPort2SSL + " and redirecting to SSL server on " + rt.Flags.HTTPPort) + rt.Log.Info("Web Server: binding non-SSL server on " + rt.Flags.ForceHTTPPort2SSL + " and redirecting to SSL server on " + rt.Flags.HTTPPort) go func() { err := http.ListenAndServe(":"+rt.Flags.ForceHTTPPort2SSL, http.HandlerFunc( @@ -119,7 +119,7 @@ func Start(rt *env.Runtime, s *domain.Store, ready chan struct{}) { rt.Log.Info("***") } - rt.Log.Info("Starting SSL server on " + rt.Flags.HTTPPort + " with " + rt.Flags.SSLCertFile + " " + rt.Flags.SSLKeyFile) + rt.Log.Info("Web Server: starting SSL server on " + rt.Flags.HTTPPort + " with " + rt.Flags.SSLCertFile + " " + rt.Flags.SSLKeyFile) // TODO: https://blog.gopheracademy.com/advent-2016/exposing-go-on-the-internet/