mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(logging): added extra logging when default config file is not found (ie homepath is not correct), fixes #6829
This commit is contained in:
parent
4c406dec2f
commit
88e1d56bc2
@ -360,9 +360,18 @@ func loadConfiguration(args *CommandLineArgs) {
|
|||||||
defaultConfigFile := path.Join(HomePath, "conf/defaults.ini")
|
defaultConfigFile := path.Join(HomePath, "conf/defaults.ini")
|
||||||
configFiles = append(configFiles, defaultConfigFile)
|
configFiles = append(configFiles, defaultConfigFile)
|
||||||
|
|
||||||
|
// check if config file exists
|
||||||
|
if _, err := os.Stat(defaultConfigFile); os.IsNotExist(err) {
|
||||||
|
fmt.Println("Grafana-server Init Failed: Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// load defaults
|
||||||
Cfg, err = ini.Load(defaultConfigFile)
|
Cfg, err = ini.Load(defaultConfigFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(3, "Failed to parse defaults.ini, %v", err)
|
fmt.Println(fmt.Sprintf("Failed to parse defaults.ini, %v", err))
|
||||||
|
os.Exit(1)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Cfg.BlockMode = false
|
Cfg.BlockMode = false
|
||||||
|
Loading…
Reference in New Issue
Block a user