Merge branch 'MSP-345' into 'master'

Resolve MSP-345

Closes MSP-345

See merge request integration-system/isp-gate-service!6
This commit is contained in:
Грязнов Денис Владимирович committed 2021-10-28 12:55:13 +00:00
commit 1fdc36d797
3 files changed
+10 -4

No files matched your search

+1 -1
View File
@@ -1 +1 @@
2.8.1
2.8.2
+2
View File
@@ -1,3 +1,5 @@
### v2.8.2
* add file rotation
### v2.8.1
* add xml format support for new logger
### v2.8.0
+7 -3
View File
@@ -128,15 +128,19 @@ func setLogger(loggerCfg, oldLoggerCfg conf.JorunalConfig) *log.Adapter {
return nil
}
// temporary for file rotation. Selected based on max size 512 mb
maxBackups := 2
var err error
oldLogger := logger
if utils.DEV {
logger, err = log.New()
} else {
logger, err = log.New(log.WithFileRotation(log.Rotation{
File: loggerCfg.Filename,
MaxSizeMb: loggerCfg.MaxSizeMb,
Compress: loggerCfg.Compress,
File: loggerCfg.Filename,
MaxSizeMb: loggerCfg.MaxSizeMb,
MaxBackups: maxBackups,
Compress: loggerCfg.Compress,
}))
}
if err != nil {