Fix logger refactoring regression: manager logging add (#24847)
The `rotate` option is optional. Test result: ![image](https://github.com/go-gitea/gitea/assets/2114189/7cff8207-dcf3-4988-adef-247f1c9316e7)
This commit is contained in:
parent
21add7ea88
commit
979f08053f
@ -155,7 +155,7 @@ func AddLogger(ctx *context.PrivateContext) {
|
||||
writerOption := log.WriterFileOption{}
|
||||
fileName, _ := opts.Config["filename"].(string)
|
||||
writerOption.FileName = setting.LogPrepareFilenameForWriter(fileName, opts.Writer+".log")
|
||||
writerOption.LogRotate = opts.Config["rotate"].(bool)
|
||||
writerOption.LogRotate, _ = opts.Config["rotate"].(bool)
|
||||
maxSizeShift, _ := opts.Config["maxsize"].(int)
|
||||
if maxSizeShift == 0 {
|
||||
maxSizeShift = 28
|
||||
|
Loading…
x
Reference in New Issue
Block a user