aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/content/administration/logging-config.en-us.md3
-rw-r--r--modules/setting/log.go2
2 files changed, 4 insertions, 1 deletions
diff --git a/docs/content/administration/logging-config.en-us.md b/docs/content/administration/logging-config.en-us.md
index d9739e1881..33470ca448 100644
--- a/docs/content/administration/logging-config.en-us.md
+++ b/docs/content/administration/logging-config.en-us.md
@@ -102,8 +102,11 @@ MODE = file, file-error
; by default, the "file" mode will record logs to %(log.ROOT_PATH)/gitea.log, so we don't need to set it
; [log.file]
+; by default, the MODE (actually it's the output writer of this logger) is taken from the section name, so we don't need to set it either
+; MODE = file
[log.file-error]
+MODE = file
LEVEL = Error
FILE_NAME = file-error.log
```
diff --git a/modules/setting/log.go b/modules/setting/log.go
index 66206f8f4b..e404074b72 100644
--- a/modules/setting/log.go
+++ b/modules/setting/log.go
@@ -165,7 +165,7 @@ func loadLogModeByName(rootCfg ConfigProvider, loggerName, modeName string) (wri
writerMode.WriterOption = writerOption
default:
if !log.HasEventWriter(writerType) {
- return "", "", writerMode, fmt.Errorf("invalid log writer type (mode): %s", writerType)
+ return "", "", writerMode, fmt.Errorf("invalid log writer type (mode): %s, maybe it needs something like 'MODE=file' in [log.%s] section", writerType, modeName)
}
}