Skip to content

Commit 5d76f97

Browse files
committed
set otel log level to match agent
1 parent 6c9f617 commit 5d76f97

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/config/config.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ func ResolveConfig() (*Config, error) {
106106
return nil, fmt.Errorf("invalid configuration: %w", err)
107107
}
108108

109+
if !viperInstance.IsSet(CollectorLogLevelKey) && strings.ToLower(log.Level) == "debug" {
110+
collector.Log.Level = "DEBUG"
111+
}
112+
109113
config := &Config{
110114
UUID: viperInstance.GetString(UUIDKey),
111115
Version: viperInstance.GetString(VersionKey),
@@ -1168,10 +1172,12 @@ func isHealthExtensionSet() bool {
11681172
}
11691173

11701174
func resolveCollectorLog() *Log {
1171-
return &Log{
1175+
log := &Log{
11721176
Level: viperInstance.GetString(CollectorLogLevelKey),
11731177
Path: viperInstance.GetString(CollectorLogPathKey),
11741178
}
1179+
1180+
return log
11751181
}
11761182

11771183
func resolveCommand() *Command {

0 commit comments

Comments
 (0)