|
@@ -140,7 +140,7 @@ type CommandLineArgs struct {
|
|
|
|
|
|
|
|
func init() {
|
|
func init() {
|
|
|
IsWindows = runtime.GOOS == "windows"
|
|
IsWindows = runtime.GOOS == "windows"
|
|
|
- log.NewLogger(0, "console", `{"level": 0}`)
|
|
|
|
|
|
|
+ log.NewLogger(0, "console", `{"level": 0, "formatting":true}`)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func parseAppUrlAndSubUrl(section *ini.Section) (string, string) {
|
|
func parseAppUrlAndSubUrl(section *ini.Section) (string, string) {
|
|
@@ -527,7 +527,11 @@ func initLogging(args *CommandLineArgs) {
|
|
|
// Generate log configuration.
|
|
// Generate log configuration.
|
|
|
switch mode {
|
|
switch mode {
|
|
|
case "console":
|
|
case "console":
|
|
|
- LogConfigs[i] = util.DynMap{"level": level}
|
|
|
|
|
|
|
+ formatting := sec.Key("formatting").MustBool(true)
|
|
|
|
|
+ LogConfigs[i] = util.DynMap{
|
|
|
|
|
+ "level": level,
|
|
|
|
|
+ "formatting": formatting,
|
|
|
|
|
+ }
|
|
|
case "file":
|
|
case "file":
|
|
|
logPath := sec.Key("file_name").MustString(filepath.Join(LogsPath, "grafana.log"))
|
|
logPath := sec.Key("file_name").MustString(filepath.Join(LogsPath, "grafana.log"))
|
|
|
os.MkdirAll(filepath.Dir(logPath), os.ModePerm)
|
|
os.MkdirAll(filepath.Dir(logPath), os.ModePerm)
|