Class CorrelationIdConverter

java.lang.Object
org.apache.logging.log4j.core.pattern.AbstractPatternConverter
org.apache.logging.log4j.core.pattern.LogEventPatternConverter
org.springframework.boot.logging.log4j2.CorrelationIdConverter
All Implemented Interfaces:
org.apache.logging.log4j.core.pattern.PatternConverter

@Plugin(name="CorrelationIdConverter", category="Converter") public final class CorrelationIdConverter extends org.apache.logging.log4j.core.pattern.LogEventPatternConverter
Log4j2 LogEventPatternConverter to convert a CorrelationIdFormatter pattern into formatted output using data from the MDC.
Since:
3.2.0
Author:
Phillip Webb
See Also:
  • MdcPatternConverter
  • Field Summary

    Fields inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter

    LOGGER

    Fields inherited from interface org.apache.logging.log4j.core.pattern.PatternConverter

    CATEGORY
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    format(org.apache.logging.log4j.core.LogEvent event, StringBuilder toAppendTo)
     
    newInstance(String[] options)
    Factory method to create a new CorrelationIdConverter.

    Methods inherited from class org.apache.logging.log4j.core.pattern.LogEventPatternConverter

    emptyVariableOutput, format, handlesThrowable, isVariable

    Methods inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter

    getName, getStyleClass

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • format

      public void format(org.apache.logging.log4j.core.LogEvent event, StringBuilder toAppendTo)
      Specified by:
      format in class org.apache.logging.log4j.core.pattern.LogEventPatternConverter
    • newInstance

      public static CorrelationIdConverter newInstance(String[] options)
      Factory method to create a new CorrelationIdConverter.
      Parameters:
      options - options, may be null or first element contains name of property to format.
      Returns:
      instance of PropertiesPatternConverter.