Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #187 from DataDog/sunhay/add_dd_log_to_console_flag
Browse files Browse the repository at this point in the history
Support DD_LOG_TO_CONSOLE environment flag
  • Loading branch information
sunhay authored Sep 12, 2018
2 parents a89794f + 8ead803 commit 320b387
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 320b387

Please sign in to comment.