fix both modify
This commit is contained in:
commit
7ca7596432
14
client.go
14
client.go
@ -230,13 +230,15 @@ func (c *client) getLogInstance(logConf *logger.InputLogConfig) (*zap.Logger, er
|
||||
var (
|
||||
err error
|
||||
loggerInstance *zap.Logger
|
||||
splitConfig *logger.RotateLogConfig
|
||||
)
|
||||
splitConfig := &logger.RotateLogConfig{
|
||||
TimeIntervalType: logConf.TimeIntervalType,
|
||||
LogPath: logConf.Path,
|
||||
LogFileName: logConf.Name,
|
||||
DivisionChar: logConf.DivisionChar,
|
||||
MaxAge: time.Duration(logConf.MaxAge) * time.Second,
|
||||
if splitConfig, err = logger.NewRotateLogConfig(
|
||||
logConf.Path,
|
||||
logConf.Name,
|
||||
logger.WithDivisionChar(logConf.DivisionChar),
|
||||
logger.WithTimeIntervalType(logConf.TimeIntervalType),
|
||||
logger.WithMaxAge(time.Duration(logConf.MaxAge)*time.Second)); nil != err {
|
||||
return nil, err
|
||||
}
|
||||
if loggerInstance, err = logger.NewLogger(zapcore.Level(logConf.LogLevel), splitConfig, logConfList...); nil != err {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user