set Spring log level to debug so that we can learn more from log

116 阅读1分钟

When I debug framework, I found there are lots of useful information which is not logged to standard output due to isFineLEvelLoggable != true.


Check our pom.xml, we are using logback-classic 1.1.7 as logging framework.

according to this link: logback.qos.ch/manual/conf…, it is very easy to enable debug log level by chaning logback.xml:

paste the following content into logback.xml:

<configuration debug="true">
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
 
        <encoder>
 
            <pattern>%date %-5level [%thread] - [%logger] [%mdc] - %msg%n</pattern>
 
        </encoder>
 
    </appender>
 
 
    <root level="debug">
 
        <appender-ref ref="STDOUT"/>
 
    </root>
 
</configuration>

And in the runtime, you can see lots of useful debug information now:

要获取更多Jerry的原创文章,请关注公众号"汪子熙":