Browse Source

feat: 修改 app.yaml 中日志备份数量参数

pull/173/head
zhengkunwang223 2 years ago committed by zhengkunwang223
parent
commit
1ef26aa4eb
  1. 2
      backend/configs/log.go
  2. 2
      backend/init/log/log.go
  3. 2
      cmd/server/conf/app.yaml

2
backend/configs/log.go

@ -5,5 +5,5 @@ type LogConfig struct {
TimeZone string `mapstructure:"timeZone"`
LogName string `mapstructure:"log_name"`
LogSuffix string `mapstructure:"log_suffix"`
LogBackup int `mapstructure:"log_backup"`
MaxBackup int `mapstructure:"max_backup"`
}

2
backend/init/log/log.go

@ -33,7 +33,7 @@ func setOutput(logger *logrus.Logger, config configs.LogConfig) {
LogPath: global.CONF.System.LogPath,
FileName: config.LogName,
TimeTagFormat: FileTImeFormat,
MaxRemain: config.LogBackup,
MaxRemain: config.MaxBackup,
RollingTimePattern: RollingTimePattern,
LogSuffix: config.LogSuffix,
})

2
cmd/server/conf/app.yaml

@ -10,4 +10,4 @@ log:
time_zone: Asia/Shanghai
log_name: 1Panel
log_suffix: .log
log_backup: 10
max_backup: 10

Loading…
Cancel
Save