aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-05-24 08:09:33 +0800
committerGitHub <noreply@github.com>2023-05-24 08:09:33 +0800
commit979f08053f1947ab09410216bcc0bc6020ef7ac9 (patch)
tree3a43d58cb9dc6c126063d55f9b7fbf19156ae9a8
parent21add7ea88ec61a80f99e3fe95eebea04c8f4506 (diff)
downloadgitea-979f08053f1947ab09410216bcc0bc6020ef7ac9.tar.gz
gitea-979f08053f1947ab09410216bcc0bc6020ef7ac9.zip
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)
-rw-r--r--routers/private/manager.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/private/manager.go b/routers/private/manager.go
index 26096c403b..397e6fac7b 100644
--- a/routers/private/manager.go
+++ b/routers/private/manager.go
@@ -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