可能因为最新版的不支持一些日志级别
注意看注释的地方
-
xml version="1.0" encoding="UTF-8"?>
-
<configuration debug="true">
-
-
<property name="LOG_HOME" value="d:/log" />
-
-
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
-
-
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
pattern>
-
encoder>
-
appender>
-
-
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-
-
<FileNamePattern>${LOG_HOME}/TestWeb.log.%d{yyyy-MM-dd-HH-mm}.log
FileNamePattern>
-
-
<MaxHistory>30
MaxHistory>
-
rollingPolicy>
-
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
-
-
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
pattern>
-
encoder>
-
-
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
-
<MaxFileSize>10MB
MaxFileSize>
-
triggeringPolicy>
-
appender>
-
-
-
<appender name="info1" class="ch.qos.logback.core.rolling.RollingFileAppender">
-
-
-
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-
<level>INFO
level>
-
filter>
-
-
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-
<fileNamePattern>${LOG_HOME}/info.%d{yyyy-MM-dd}.log
-
fileNamePattern>
-
-
<maxHistory>15
maxHistory>
-
rollingPolicy>
-
-
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
-
<pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} | %thread | %-5level | %class{20}:%file\(%line\) | %msg%n
pattern>
-
encoder>
-
appender>
-
-
<appender name="debug1" class="ch.qos.logback.core.rolling.RollingFileAppender">
-
-
-
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-
<level>debug
level>
-
-
filter>
-
-
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-
<fileNamePattern>${LOG_HOME}/debug.%d{yyyy-MM-dd}.log
-
fileNamePattern>
-
-
<maxHistory>15
maxHistory>
-
rollingPolicy>
-
-
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
-
<pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} | %thread | %-5level | %class{20}:%file\(%line\) | %msg%n
pattern>
-
encoder>
-
appender>
-
-
-
-
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
-
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
-
<logger name="org.hibernate.SQL" level="DEBUG" />
-
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
-
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
-
-
-
<logger name="com.apache.ibatis" level="TRACE"/>
-
<logger name="java.sql.Connection" level="DEBUG"/>
-
<logger name="java.sql.Statement" level="DEBUG"/>
-
<logger name="java.sql.PreparedStatement" level="DEBUG"/>
-
-
-
<root level="INFO">
-
<appender-ref ref="STDOUT" />
-
<appender-ref ref="FILE" />
-
<appender-ref ref="info1" />
-
<appender-ref ref="debug1" />
-
root>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
configuration>
原文地址:https://blog.csdn.net/bestxianfeng163/article/details/83616492