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>
This commit is contained in:
zeripathandtechknowlogick authored and GitHub committed 2020-05-15 22:38:52 -04:00
1 parent 1d54479585
commit 0052d788da
2 files changed
+18 -4

No files matched your search

+5 -2
View File
@@ -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)