diff options
author | zeripath <art27@cantab.net> | 2020-05-16 03:38:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 22:38:52 -0400 |
commit | 0052d788daf0bdc938d6189da880b5113a1113c6 (patch) | |
tree | 35c2bbd88feb4ce4ec5a907891bc19665d434bf7 /modules/setting/log.go | |
parent | 1d54479585362c67ec5a6779df5b2bde874252a3 (diff) | |
download | gitea-0052d788daf0bdc938d6189da880b5113a1113c6.tar.gz gitea-0052d788daf0bdc938d6189da880b5113a1113c6.zip |
Allow log.xxx.default to set logging settings for the default logger only (#11292)
* Allow log.xxx.default to set logging settings for the default logger only
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update modules/setting/log.go
* as per @silverwind add some documentation
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules/setting/log.go')
-rw-r--r-- | modules/setting/log.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/setting/log.go b/modules/setting/log.go index e7a4658006..5ffb2479dd 100644 --- a/modules/setting/log.go +++ b/modules/setting/log.go @@ -261,9 +261,12 @@ func newLogService() { continue } - sec, err := Cfg.GetSection("log." + name) + sec, err := Cfg.GetSection("log." + name + ".default") if err != nil { - sec, _ = Cfg.NewSection("log." + name) + sec, err = Cfg.GetSection("log." + name) + if err != nil { + sec, _ = Cfg.NewSection("log." + name) + } } provider, config, levelName := generateLogConfig(sec, name, options) |