Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Commit

Permalink
config: account for log_file coming from yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
gbbr committed Apr 11, 2018
1 parent 564d3dc commit cc464d4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/merge_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type traceAgent struct {
ExtraSampleRate float64 `yaml:"extra_sample_rate"`
MaxTracesPerSecond float64 `yaml:"max_traces_per_second"`
IgnoreResources []string `yaml:"ignore_resources"`
LogFilePath string `yaml:"log_file"`
ReplaceTags []*ReplaceRule `yaml:"replace_tags"`
ReceiverPort int `yaml:"receiver_port"`
APMNonLocalTraffic *bool `yaml:"apm_non_local_traffic"`
Expand Down Expand Up @@ -129,6 +130,9 @@ func mergeYamlConfig(agentConf *AgentConfig, yc *YamlAgentConfig) error {
if yc.HostName != "" {
agentConf.HostName = yc.HostName
}
if yc.LogLevel != "" {
agentConf.LogLevel = yc.LogLevel
}
if yc.StatsdPort > 0 {
agentConf.StatsdPort = yc.StatsdPort
}
Expand Down Expand Up @@ -166,6 +170,10 @@ func mergeYamlConfig(agentConf *AgentConfig, yc *YamlAgentConfig) error {
agentConf.APIEndpoint = yc.TraceAgent.Endpoint
}

if yc.TraceAgent.LogFilePath != "" {
agentConf.LogFilePath = yc.TraceAgent.LogFilePath
}

if yc.TraceAgent.Env != "" {
agentConf.DefaultEnv = model.NormalizeTag(yc.TraceAgent.Env)
}
Expand Down

0 comments on commit cc464d4

Please sign in to comment.