I think this also should work for log4j2. I use this simple way of disabling logs from specific libraries in SpringBoot applications. You need just add it into the log4j2.xml file.
<Loggers>
<Root>
****** here is some AppenderRef *******
</Root>
<Logger name="o.a.pdfbox" level="off"/>
or
<Logger name="org.apache.pdfbox" level="off"/>
</Loggers>