I am using log4j2 and using log4j2.xml for its configuration. I am configuring the PatternLayout and its pattern currently is %d [%t] %p %c - %m%n. It is the same value as PatternLayout.SIMPLE_CONVERSION_PATTERN defined in log4j2 core Javadoc. So is it possible to reference this variable instead of copy the value into the xml?
My full log4j2.xml is attached for your reference.
<?xml version="1.0" encoding="UTF-8"?> <Configuration status="WARN"> <Appenders> <Console name="consoleAppender" target="SYSTEM_OUT"> <PatternLayout pattern="%d [%t] %p %c - %m%n" /> </Console> </Appenders> <Loggers> <Root level="ALL"> <AppenderRef ref="consoleAppender" /> </Root> </Loggers> </Configuration>