Here's what I have been using in the "old" log4j log4j.properties
file (you should migrate to log4j2):
log4j.logger.org.springframework=WARN
log4j.logger.org.apache.pdfbox.pdmodel.font.PDCIDFontType2=FATAL
In the "new" log4j2.xml
I have this (the appenders are named STDOUT
and A1
):
<?xml version="1.0" encoding="UTF-8"?>
<!-- https://logging.apache.org/log4j/2.x/manual/configuration.html
https://logging.apache.org/log4j/2.x/manual/appenders.html
-->
<Configuration>
<Appenders>
....
....
</Appenders>
<Loggers>
<Logger name="org.springframework" level="warn" additivity="false">
<AppenderRef ref="STDOUT"/>
<AppenderRef ref="A1"/>
</Logger>
<Logger name="org.apache.pdfbox.pdmodel.font.PDCIDFontType2" level="fatal" additivity="false">
<AppenderRef ref="STDOUT"/>
<AppenderRef ref="A1"/>
</Logger>
<Root level="info">
<AppenderRef ref="STDOUT"/>
<AppenderRef ref="A1"/>
</Root>
</Loggers>
</Configuration>