Class EnclosedInSquareBracketsConverter

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

@Plugin(name="enclosedInSquareBrackets", category="Converter") public final class EnclosedInSquareBracketsConverter extends org.apache.logging.log4j.core.pattern.LogEventPatternConverter
Log4j2 LogEventPatternConverter used to help format optional values that should be shown enclosed in square brackets.
Since:
3.4.0
Author:
Phillip Webb
  • 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(org.apache.logging.log4j.core.config.Configuration config, String[] options)
    Creates a new instance of the class.

    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 EnclosedInSquareBracketsConverter newInstance(org.apache.logging.log4j.core.config.Configuration config, String[] options)
      Creates a new instance of the class. Required by Log4J2.
      Parameters:
      config - the configuration
      options - the options
      Returns:
      a new instance, or null if the options are invalid