From 0052d788daf0bdc938d6189da880b5113a1113c6 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 16 May 2020 03:38:52 +0100 Subject: 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 * Update modules/setting/log.go * as per @silverwind add some documentation Signed-off-by: Andrew Thornton Co-authored-by: techknowlogick --- modules/setting/log.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules/setting') 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) -- cgit v1.2.3