aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-05-16 03:38:52 +0100
committerGitHub <noreply@github.com>2020-05-15 22:38:52 -0400
commit0052d788daf0bdc938d6189da880b5113a1113c6 (patch)
tree35c2bbd88feb4ce4ec5a907891bc19665d434bf7 /modules
parent1d54479585362c67ec5a6779df5b2bde874252a3 (diff)
downloadgitea-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')
-rw-r--r--modules/setting/log.go7
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)