This documentation has an index for AI agents at /llms.txt. A Markdown version of this page is available at https://explorer.opentelemetry.io/java-agent/instrumentation/log4j-appender-1.2.md.

Log4j

OpenTelemetry Java agent instrumentation

This instrumentation bridges Log4j log events to OpenTelemetry logs.

  • Name: log4j-appender-1.2
  • Scope: io.opentelemetry.log4j-appender-1.2
  • Target versions: log4j:log4j:[1.2,)
  • Library: https://logging.apache.org/log4j/1.2/

Configuration

OptionTypeDefaultDescription
otel.instrumentation.log4j-appender.experimental-log-attributesbooleanfalseEnables the capture of experimental log attributes, including thread name and thread ID.
otel.instrumentation.log4j-appender.experimental.capture-code-attributesbooleanfalseEnables the capture of code location attributes, including file path, class name, method name, and line number.
otel.instrumentation.log4j-appender.experimental.capture-mdc-attributeslistControls which MDC attributes to capture. Use "*" to capture all MDC attributes or provide a comma-separated list of specific keys.

Data

  • JSON: /data/javaagent/instrumentations/log4j-appender-1.2/log4j-appender-1.2-efb6f9340880.json
  • Explore: /java-agent/instrumentation/log4j-appender-1.2