通过对 logback.xml 文件配置,即可实现对不同日志的打印设置,如下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="com/onlyou/framework/boot/logback/default.xml"/>
<logger name="springfox" level="info" />
<logger name="org.mongodb.driver" level="info" />
<logger name="sun.rmi" level="info" />
<property name="LOG_MAX_HISTORY_COUNT" value="7"/>
<!-- httpclient 相关的日志打印级别限制,仅对warn及以上级别日志打印 -->
<logger name="org.apache" level="WARN" />
<logger name="httpclient" level="WARN" />
</configuration>