Files
bj_power/bj_power_mes/common/logx/config.go
T

16 lines
966 B
Go

package log
type LogConf struct {
Level string `json:",default=INFO"` // 日志级别: DEBUG, INFO, WARN, ERROR
Format string `json:",default=text"` // 日志格式: text, json
TimeFormat string `json:",default=2006-01-02 15:04:05"` // 时间格式
Filename string `json:",default=spcm.log"` // 日志文件名
MaxSize int `json:",default=100"` // 单个日志文件最大大小(MB)
MaxBackups int `json:",default=10"` // 保留的旧日志文件数量
MaxAge int `json:",default=30"` // 日志文件保留天数
Compress bool `json:",default=true"` // 是否压缩旧日志文件
Console bool `json:",default=false"` // 是否同时输出到控制台
AddSource bool `json:",default=false"` // 是否在日志中添加文件名和行号
Stats bool `json:",default=false"`
}