Package log

Class Log4jDevelopmentPatternConverter

java.lang.Object
org.apache.logging.log4j.core.pattern.AbstractPatternConverter
org.apache.logging.log4j.core.pattern.LogEventPatternConverter
log.Log4jDevelopmentPatternConverter
All Implemented Interfaces:
org.apache.logging.log4j.core.pattern.PatternConverter

@Plugin(name="DevPatternConverter", category="Converter") public class Log4jDevelopmentPatternConverter extends org.apache.logging.log4j.core.pattern.LogEventPatternConverter
Pattern converter for Log4j 2.x that adds a hyperlink for the calling class of the current log message. This is to be used in log4j configurations as part of a pattern layout. eg: <PatternLayout pattern="%-5p %m %hl %n"/> See generic.log4jdev.xml for a working example.
  • 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
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Required constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    format(org.apache.logging.log4j.core.LogEvent event, StringBuilder toAppendTo)
    Appends the desired hyperlink to the existing event message.
    newInstance(String[] options)
    Required instance method for all log4j 2.x converters.

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

    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
  • Constructor Details

    • Log4jDevelopmentPatternConverter

      protected Log4jDevelopmentPatternConverter(String name, String style)
      Required constructor.
      Parameters:
      name - the name of the converter
      style - the style of the converter
  • Method Details

    • newInstance

      public static Log4jDevelopmentPatternConverter newInstance(String[] options)
      Required instance method for all log4j 2.x converters.
      Parameters:
      options - unused
      Returns:
      new converter instance
    • format

      public void format(org.apache.logging.log4j.core.LogEvent event, StringBuilder toAppendTo)
      Appends the desired hyperlink to the existing event message.
      Specified by:
      format in class org.apache.logging.log4j.core.pattern.LogEventPatternConverter
      Parameters:
      event - the current log event
      toAppendTo - the string to append to