java.lang.Object
io.opentelemetry.instrumentation.log4j.appender.v2_17.internal.LogEventMapper<T>

public final class LogEventMapper<T> extends Object
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
  • Constructor Details

    • LogEventMapper

      public LogEventMapper(ContextDataAccessor<T> contextDataAccessor, boolean captureExperimentalAttributes, boolean captureMapMessageAttributes, boolean captureMarkerAttribute, List<String> captureContextDataAttributes)
  • Method Details

    • mapLogEvent

      public void mapLogEvent(io.opentelemetry.api.logs.LogRecordBuilder builder, org.apache.logging.log4j.message.Message message, org.apache.logging.log4j.Level level, @Nullable org.apache.logging.log4j.Marker marker, @Nullable Throwable throwable, T contextData)
      Map the LogEvent data model onto the LogRecordBuilder. Unmapped fields include:
      • Fully qualified class name - LogEvent.getLoggerFqcn()
      • Thread name - LogEvent.getThreadName()
      • Thread id - LogEvent.getThreadId()
      • Thread priority - LogEvent.getThreadPriority()
      • Marker - LogEvent.getMarker()
      • Nested diagnostic context - LogEvent.getContextStack()
    • getContextDataAttributeKey

      public static io.opentelemetry.api.common.AttributeKey<String> getContextDataAttributeKey(String key)
    • getMapMessageAttributeKey

      public static io.opentelemetry.api.common.AttributeKey<String> getMapMessageAttributeKey(String key)