Skip to content

Commit

Permalink
Synch code with OTel code
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanbisutti authored and trask committed Oct 18, 2022
1 parent 3b7e366 commit 5b773d1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ public class LogDataMapper {
private final boolean captureLoggingLevelAsCustomDimension;
private final BiConsumer<AbstractTelemetryBuilder, Resource> telemetryInitializer;

private static final AttributeKey<String> OTEL_LOG_MARKER = AttributeKey.stringKey("log.marker");
private static final AttributeKey<String> OTEL_LOG4J_MARKER =
AttributeKey.stringKey("log4j.marker");

private static final AttributeKey<String> OTEL_LOGBACK_MARKER =
AttributeKey.stringKey("logback.marker");

public LogDataMapper(
boolean captureLoggingLevelAsCustomDimension,
Expand Down Expand Up @@ -174,7 +178,7 @@ private static void setExtraAttributes(
telemetryBuilder.addProperty("LineNumber", String.valueOf(value));
return;
}
if (OTEL_LOG_MARKER.getKey().equals(key)) {
if (OTEL_LOG4J_MARKER.getKey().equals(key) || OTEL_LOGBACK_MARKER.getKey().equals(key)) {
telemetryBuilder.addProperty("Marker", String.valueOf(value));
return;
}
Expand Down

0 comments on commit 5b773d1

Please sign in to comment.