Basic log4j2.xml configuration file
suggest change<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} %m%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
This basic log4j2.xml configuration has a console appender and a root logger. The pattern layout is the format of each logged event. To debug configuration loading, set the status attribute on Configuration, for example status="DEBUG" (WARN, ERROR, FATAL, TRACE, and INFO are the other levels). monitorInterval="30" rechecks the file every 30 seconds and reloads it if it changed.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents