I have a simple java console application. pdfbox is utilized to extract text from PDF files. But there is continuous info printed in console:
十一月 29, 2017 9:28:27 下午 org.apache.pdfbox.pdmodel.font.PDSimpleFont toUnicode
警告: No Unicode mapping for 14 (145) in font GGNHDZ+SimSun
十一月 29, 2017 9:28:27 下午 org.apache.pdfbox.pdmodel.font.PDSimpleFont toUnicode
警告: No Unicode mapping for 28 (249) in font LNKLJH+SimSun
十一月 29, 2017 9:28:27 下午 org.apache.pdfbox.pdmodel.font.PDSimpleFont toUnicode
I really want to remove this information from the console. And I use logback for logging, the logback.xml is just like:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<logger name="org.apache.pdfbox" level="ERROR"/>
<timestamp key="timestamp-by-second" datePattern="yyyyMMdd'T'HHmmss"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoder 默认配置为PatternLayoutEncoder -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>logs/test-${timestamp-by-second}.log</file>
<append>true</append>
<encoder>
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n
</pattern>
</encoder>
</appender>
<root level="ERROR">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
I have find some answer say that should change the Level. I have changed the level to ERROR. But still not work. I am doubting if the info has something with logback.xml. Because when I remove STDOUT, the pdfbox warn info still print in the console.
Anybody know this case? Thank you in advance.