mirror of
https://github.com/grafana/grafana.git
synced 2025-01-18 20:43:26 -06:00
put the default logger format and feature toggle to fallback to old logger (#47584)
This commit is contained in:
parent
232d880fe0
commit
06d2d44031
@ -446,7 +446,9 @@ func ReadLoggingConfig(modes []string, logsPath string, cfg *ini.File) error {
|
||||
}
|
||||
|
||||
var err error
|
||||
root.gokitLogActivated, err = isNewLoggerActivated(cfg)
|
||||
isOldLoggerActivated, err := isOldLoggerActivated(cfg)
|
||||
root.gokitLogActivated = !isOldLoggerActivated
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -459,13 +461,13 @@ func ReadLoggingConfig(modes []string, logsPath string, cfg *ini.File) error {
|
||||
|
||||
// This would be removed eventually, no need to make a fancy design.
|
||||
// For the sake of important cycle I just copied the function
|
||||
func isNewLoggerActivated(cfg *ini.File) (bool, error) {
|
||||
func isOldLoggerActivated(cfg *ini.File) (bool, error) {
|
||||
section := cfg.Section("feature_toggles")
|
||||
toggles, err := readFeatureTogglesFromInitFile(section)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return toggles["newlog"], nil
|
||||
return toggles["oldlog"], nil
|
||||
}
|
||||
|
||||
func readFeatureTogglesFromInitFile(featureTogglesSection *ini.Section) (map[string]bool, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user