1
0
Fork 0
forked from forgejo/forgejo

Clarify the logger's MODE config option (#26267) (#26281)

Backport #26267 by @wxiaoguang

1. Fix the wrong document (add the missing `MODE=`)
2. Add a more friendly log message to tell users to add `MODE=` in their
config

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit a758337046)
This commit is contained in:
Giteabot 2023-08-02 07:08:28 +08:00 committed by Earl Warren
parent bd416d0ba9
commit b97dbf7a9e
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 4 additions and 1 deletions

View file

@ -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)
}
}