更新 redis log
This commit is contained in:
parent
8cb936a57b
commit
35a75ea21e
@ -52,7 +52,7 @@ type RotateLogConfig struct {
|
||||
MaxAge time.Duration `json:"max_age" yaml:"max_age"` // 日志最长保存时间
|
||||
}
|
||||
|
||||
// SetRotateLogConfigOption 设置日志切割的选项
|
||||
// SetRotateLogConfigFunc 设置日志切割的选项
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
|
@ -150,9 +150,17 @@ func (c *Client) getLogger(conf *LoggerConfig) (*zap.Logger, error) {
|
||||
if conf.Encoder != nil {
|
||||
optionFuncList = append(optionFuncList, logger.WithEncoder(conf.Encoder))
|
||||
}
|
||||
|
||||
splitConfigFuncList := []logger.SetRotateLogConfigFunc{
|
||||
logger.WithTimeIntervalType(conf.SplitConfig.TimeIntervalType),
|
||||
logger.WithDivisionChar(conf.SplitConfig.DivisionChar),
|
||||
logger.WithMaxAge(conf.SplitConfig.MaxAge),
|
||||
}
|
||||
|
||||
splitConfig, _ := logger.NewRotateLogConfig(conf.SplitConfig.LogPath, conf.SplitConfig.LogFileName, splitConfigFuncList...)
|
||||
return logger.NewLogger(
|
||||
conf.LoggerLevel,
|
||||
conf.SplitConfig,
|
||||
splitConfig,
|
||||
optionFuncList...,
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user