diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-09-15 15:59:29 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-09-15 15:59:29 -0400 |
commit | 1bbb5265be24476faa2d44f8538918708391bde8 (patch) | |
tree | 5f1b30ec8a4cf1dfa1366b7945accb502add43ba /utils/config.go | |
parent | bbb0607e1ddf3e3d530095ba2aa28abd9c49a3e4 (diff) | |
parent | 23a1311ef5f9ecac0a250419a49e74b290e63516 (diff) | |
download | chat-1bbb5265be24476faa2d44f8538918708391bde8.tar.gz chat-1bbb5265be24476faa2d44f8538918708391bde8.tar.bz2 chat-1bbb5265be24476faa2d44f8538918708391bde8.zip |
Merge pull request #681 from mattermost/PLT-12-log
PLT-12 Adding server logs viewer to admin console
Diffstat (limited to 'utils/config.go')
-rw-r--r-- | utils/config.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/utils/config.go b/utils/config.go index c67e17e79..a1d282c29 100644 --- a/utils/config.go +++ b/utils/config.go @@ -11,9 +11,10 @@ import ( ) const ( - MODE_DEV = "dev" - MODE_BETA = "beta" - MODE_PROD = "prod" + MODE_DEV = "dev" + MODE_BETA = "beta" + MODE_PROD = "prod" + LOG_ROTATE_SIZE = 10000 ) type ServiceSettings struct { @@ -180,10 +181,10 @@ func ConfigureCmdLineLog() { ls.ConsoleEnable = true ls.ConsoleLevel = "ERROR" ls.FileEnable = false - configureLog(ls) + configureLog(&ls) } -func configureLog(s LogSettings) { +func configureLog(s *LogSettings) { l4g.Close() @@ -217,7 +218,7 @@ func configureLog(s LogSettings) { flw := l4g.NewFileLogWriter(s.FileLocation, false) flw.SetFormat(s.FileFormat) flw.SetRotate(true) - flw.SetRotateLines(100000) + flw.SetRotateLines(LOG_ROTATE_SIZE) l4g.AddFilter("file", level, flw) } } @@ -241,7 +242,7 @@ func LoadConfig(fileName string) { panic("Error decoding config file=" + fileName + ", err=" + err.Error()) } - configureLog(config.LogSettings) + configureLog(&config.LogSettings) Cfg = &config SanitizeOptions = getSanitizeOptions() |