From 686c2fbab7607d42183ae685a27ea3d7dce8c3f6 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 27 Apr 2018 12:49:45 -0700 Subject: Structured logging (#8673) * Implementing structured logging * Changes to en.json to allow refactor to run. * Fixing global logger * Structured logger initalization. * Add caller. * Do some log redirection. * Auto refactor * Cleaning up l4g reference and removing dependancy. * Removing junk. * Copyright headers. * Fixing tests * Revert "Changes to en.json to allow refactor to run." This reverts commit fd8249e99bcad0231e6ea65cd77c32aae9a54026. * Fixing some auto refactor strangeness and typo. * Making keys more human readable. --- app/license.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'app/license.go') diff --git a/app/license.go b/app/license.go index 148b10317..310a61fdb 100644 --- a/app/license.go +++ b/app/license.go @@ -9,8 +9,7 @@ import ( "net/http" "strings" - l4g "github.com/alecthomas/log4go" - + "github.com/mattermost/mattermost-server/mlog" "github.com/mattermost/mattermost-server/model" "github.com/mattermost/mattermost-server/utils" ) @@ -30,7 +29,7 @@ func (a *App) LoadLicense() { if license != nil { if _, err := a.SaveLicense(licenseBytes); err != nil { - l4g.Info("Failed to save license key loaded from disk err=%v", err.Error()) + mlog.Info(fmt.Sprintf("Failed to save license key loaded from disk err=%v", err.Error())) } else { licenseId = license.Id } @@ -40,9 +39,9 @@ func (a *App) LoadLicense() { if result := <-a.Srv.Store.License().Get(licenseId); result.Err == nil { record := result.Data.(*model.LicenseRecord) a.ValidateAndSetLicenseBytes([]byte(record.Bytes)) - l4g.Info("License key valid unlocking enterprise features.") + mlog.Info("License key valid unlocking enterprise features.") } else { - l4g.Info(utils.T("mattermost.load_license.find.warn")) + mlog.Info("License key from https://mattermost.com required to unlock enterprise features.") } } @@ -140,7 +139,7 @@ func (a *App) ValidateAndSetLicenseBytes(b []byte) { return } - l4g.Warn(utils.T("utils.license.load_license.invalid.warn")) + mlog.Warn("No valid enterprise license found") } func (a *App) SetClientLicense(m map[string]string) { -- cgit v1.2.3-1-g7c22