mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Logging: Fix don't return an error trying to initialize the file logger (#42952)
Fixes #42897 Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
This commit is contained in:
parent
8217d6d206
commit
7f2d3055d8
@ -417,7 +417,7 @@ func ReadLoggingConfig(modes []string, logsPath string, cfg *ini.File) error {
|
||||
dpath := filepath.Dir(fileName)
|
||||
if err := os.MkdirAll(dpath, os.ModePerm); err != nil {
|
||||
_ = level.Error(root).Log("Failed to create directory", "dpath", dpath, "err", err)
|
||||
return errutil.Wrapf(err, "failed to create log directory %q", dpath)
|
||||
continue
|
||||
}
|
||||
fileHandler := NewFileWriter()
|
||||
fileHandler.Filename = fileName
|
||||
@ -429,7 +429,7 @@ func ReadLoggingConfig(modes []string, logsPath string, cfg *ini.File) error {
|
||||
fileHandler.Maxdays = sec.Key("max_days").MustInt64(7)
|
||||
if err := fileHandler.Init(); err != nil {
|
||||
_ = level.Error(root).Log("Failed to initialize file handler", "dpath", dpath, "err", err)
|
||||
return errutil.Wrapf(err, "failed to initialize file handler")
|
||||
continue
|
||||
}
|
||||
|
||||
loggersToClose = append(loggersToClose, fileHandler)
|
||||
|
Loading…
Reference in New Issue
Block a user