github.com/lingyao2333/mo-zero@v1.4.1/core/logx/config.go (about)

     1  package logx
     2  
     3  // A LogConf is a logging config.
     4  type LogConf struct {
     5  	ServiceName         string `json:",optional"`
     6  	Mode                string `json:",default=console,options=[console,file,volume]"`
     7  	Encoding            string `json:",default=json,options=[json,plain]"`
     8  	TimeFormat          string `json:",optional"`
     9  	Path                string `json:",default=logs"`
    10  	Level               string `json:",default=info,options=[debug,info,error,severe]"`
    11  	Compress            bool   `json:",optional"`
    12  	KeepDays            int    `json:",optional"`
    13  	StackCooldownMillis int    `json:",default=100"`
    14  	// MaxBackups represents how many backup log files will be kept. 0 means all files will be kept forever.
    15  	// Only take effect when RotationRuleType is `size`.
    16  	// Even thougth `MaxBackups` sets 0, log files will still be removed
    17  	// if the `KeepDays` limitation is reached.
    18  	MaxBackups int `json:",default=0"`
    19  	// MaxSize represents how much space the writing log file takes up. 0 means no limit. The unit is `MB`.
    20  	// Only take effect when RotationRuleType is `size`
    21  	MaxSize int `json:",default=0"`
    22  	// RotationRuleType represents the type of log rotation rule. Default is `daily`.
    23  	// daily: daily rotation.
    24  	// size: size limited rotation.
    25  	Rotation string `json:",default=daily,options=[daily,size]"`
    26  }