From 8ead8037be2553b180d4a1b62b45c1a29daea4e9 Mon Sep 17 00:00:00 2001 From: Sunny Klair Date: Wed, 12 Sep 2018 15:15:58 -0400 Subject: [PATCH] Support DD_LOG_TO_CONSOLE environment flag --- config/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/config.go b/config/config.go index d5475cd6e..3b918fd23 100644 --- a/config/config.go +++ b/config/config.go @@ -430,12 +430,17 @@ func mergeEnvironmentVariables(c *AgentConfig) *AgentConfig { if v := os.Getenv("DD_LOG_LEVEL"); v != "" { c.LogLevel = v } + + // Logging to console if enabled, err := isAffirmative(os.Getenv("DD_LOGS_STDOUT")); err == nil { c.LogToConsole = enabled } if enabled, err := isAffirmative(os.Getenv("LOG_TO_CONSOLE")); err == nil { c.LogToConsole = enabled } + if enabled, err := isAffirmative(os.Getenv("DD_LOG_TO_CONSOLE")); err == nil { + c.LogToConsole = enabled + } if c.proxy, err = proxyFromEnv(c.proxy); err != nil { log.Errorf("error parsing proxy settings, not using a proxy: %s", err)