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
ModifierConstructorDescriptionprotected
Log4jDevelopmentPatternConverter
(String name, String style) Required constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
-
Constructor Details
-
Log4jDevelopmentPatternConverter
Required constructor.- Parameters:
name
- the name of the converterstyle
- the style of the converter
-
-
Method Details
-
newInstance
Required instance method for all log4j 2.x converters.- Parameters:
options
- unused- Returns:
- new converter instance
-
format
Appends the desired hyperlink to the existing event message.- Specified by:
format
in classorg.apache.logging.log4j.core.pattern.LogEventPatternConverter
- Parameters:
event
- the current log eventtoAppendTo
- the string to append to
-