logx conf add DisableStat (#2434)
Co-authored-by: sunsoft <sunsoft@qq.com>
This commit is contained in:
@@ -9,6 +9,7 @@ type LogConf struct {
|
|||||||
Path string `json:",default=logs"`
|
Path string `json:",default=logs"`
|
||||||
Level string `json:",default=info,options=[debug,info,error,severe]"`
|
Level string `json:",default=info,options=[debug,info,error,severe]"`
|
||||||
Compress bool `json:",optional"`
|
Compress bool `json:",optional"`
|
||||||
|
DisableStat bool `json:",optional"`
|
||||||
KeepDays int `json:",optional"`
|
KeepDays int `json:",optional"`
|
||||||
StackCooldownMillis int `json:",default=100"`
|
StackCooldownMillis int `json:",default=100"`
|
||||||
// MaxBackups represents how many backup log files will be kept. 0 means all files will be kept forever.
|
// MaxBackups represents how many backup log files will be kept. 0 means all files will be kept forever.
|
||||||
|
|||||||
@@ -230,6 +230,10 @@ func SetUp(c LogConf) (err error) {
|
|||||||
setupOnce.Do(func() {
|
setupOnce.Do(func() {
|
||||||
setupLogLevel(c)
|
setupLogLevel(c)
|
||||||
|
|
||||||
|
if (c.DisableStat){
|
||||||
|
DisableStat()
|
||||||
|
}
|
||||||
|
|
||||||
if len(c.TimeFormat) > 0 {
|
if len(c.TimeFormat) > 0 {
|
||||||
timeFormat = c.TimeFormat
|
timeFormat = c.TimeFormat
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user