1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-02 10:07:07 -05:00

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:
wxiaoguang 2023-05-24 08:09:33 +08:00 committed by GitHub
parent 21add7ea88
commit 979f08053f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,7 +155,7 @@ func AddLogger(ctx *context.PrivateContext) {
writerOption := log.WriterFileOption{} writerOption := log.WriterFileOption{}
fileName, _ := opts.Config["filename"].(string) fileName, _ := opts.Config["filename"].(string)
writerOption.FileName = setting.LogPrepareFilenameForWriter(fileName, opts.Writer+".log") 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) maxSizeShift, _ := opts.Config["maxsize"].(int)
if maxSizeShift == 0 { if maxSizeShift == 0 {
maxSizeShift = 28 maxSizeShift = 28