Hi,
I’d like to connect logs with traces and I’m on Log4J 1.x for a subcomponent that cannot be upgraded to Log4J 2.x. I see Dynatrace supports automatic log enrichment for Log4j 2.x but not for Log4J 1.x. I verified the logs and don’t see dt.span_id, dt.trace_id, dt.trace_sampled and dt.entity.process_group_instance in the log files
How can I manually enrich the logs from log4j 1.x so that they are associated with a trace? I tried adding dt.span_id, dt.trace_id, dt.trace_sampled and dt.entity.process_group_instance using a log4j pattern layout like below but the log files have empty values for these variables.
<PatternLayout pattern=“%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} dt.trace_id=%X{dt.trace_id} dt.span_id=%X{dt.span_id} dt.entity.process_group_instance=%X{dt.entity.process_group_instance} - %msg%n”/>
I suspect with Log4J 1.x these values are not set as MDC variables so the logs don’t have them as well. How do I associate the logs from Log4J 1.x to traces?
Thanks