Skip to content

Commit f243106

Browse files
committed
fix span logging activation
1 parent 0357640 commit f243106

File tree

1 file changed

+4
-7
lines changed
  • internal-logging/src/main/java/co/elastic/otel/logging

1 file changed

+4
-7
lines changed

internal-logging/src/main/java/co/elastic/otel/logging/AgentLog.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,12 @@ public static void init() {
7171
public static void addSpanLoggingIfRequired(
7272
SdkTracerProviderBuilder providerBuilder, ConfigProperties config) {
7373

74-
boolean otelDebug = config.getBoolean(OTEL_JAVAAGENT_DEBUG, false);
75-
76-
// Replicate behavior of upstream agent: span logging exporter is automatically added
77-
// when not already present when debugging.
78-
// When logging exporter has been explicitly configured, spans logging will be done by the
79-
// explicitly configured logging exporter instance
74+
// Replicate behavior of the upstream agent: span logging exporter is automatically added when
75+
// not already present when debugging. When logging exporter has been explicitly configured,
76+
// spans logging will be done by the explicitly configured logging exporter instance.
8077
boolean loggingExporterNotAlreadyConfigured =
8178
!config.getList("otel.traces.exporter", emptyList()).contains("logging");
82-
if (otelDebug && loggingExporterNotAlreadyConfigured) {
79+
if (loggingExporterNotAlreadyConfigured) {
8380
providerBuilder.addSpanProcessor(SimpleSpanProcessor.create(debugLogSpanExporter));
8481
}
8582
}

0 commit comments

Comments
 (0)