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:
zeripath 2020-05-16 03:38:52 +01:00 committed by GitHub
parent 1d54479585
commit 0052d788da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

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)