You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds examples for Log4j 2's JSON format log template layout (#29985)
* Adds examples for Log4j 2's JSON format log template layout
- Adds a full example for Log4j 2's JSON format log template layout file, MyLayout.json
- Adds an instruction to remove dd.trace_id and dd_span.id from the template layout examples, if the log and trace correlation is not used.
* Update java.md
* Update content/en/logs/log_collection/java.md
---------
Co-authored-by: Esther Kim <[email protected]>
If APM is enabled for this application, you can correlate logs and traces by enabling trace ID injection. See [Connecting Java Logs and Traces][3] for more information.
246
-
247
298
### Raw format
248
299
249
300
{{< tabs >}}
@@ -341,7 +392,20 @@ writer.file = log.txt
341
392
342
393
If APM is enabled for this application, you can correlate logs and traces by enabling trace ID injection. See [Connecting Java Logs and Traces][3].
343
394
344
-
If you are _not_ correlating logs and traces, you can remove the MDC placeholders (`%X{dd.trace_id} %X{dd.span_id}`) from the log patterns included in the above configuration examples.
395
+
If you are _not_ correlating logs and traces, remove the MDC placeholders (`%X{dd.trace_id} %X{dd.span_id}`) from the log patterns included in the previous configuration examples.
396
+
397
+
For example, if you are using Log4j 2 but not correlating logs and traces, remove the following block from the example log layout template, `MyLayout.json`:
0 commit comments