37logback
<?xml version="1.0" encoding="UTF-8"?> <configuration debug="false" scan="true" scanPeriod="1000 seconds"> <timestamp key="date" datePattern="yyyyMMdd" /> <!-- 控制台输出 --> <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%date [%thread] %-5level %logger{80} - %msg%n</pattern> </encoder> </appender> <!-- 时间滚动输出 level为 DEBUG 日志 --> <appender name="file-debug" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.LevelFilter"> <level>DEBUG</level> <onMatch>ACCEPT</onMatch> <onMismatch>DENY </onMismatch> </filter> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern>/cloudCang_log/cloudCang-mgr/cloudCang-mgr_debug.%d{yyyy-MM-dd}.log</FileNamePattern> <MaxHistory>30</MaxHistory> </rollingPolicy> <encoder> <pattern>%date [%thread] %-5level %logger{80} - %msg%n</pattern> </encoder> </appender> <!-- 时间滚动输出 level为 Info 日志 --> <appender name="file-info" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.LevelFilter"> <level>INFO</level> <onMatch>ACCEPT</onMatch> <onMismatch>DENY </onMismatch> </filter> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern>/cloudCang_log/cloudCang-mgr/cloudCang-mgr_info.%d{yyyy-MM-dd}.log</FileNamePattern> <MaxHistory>30</MaxHistory> </rollingPolicy> <encoder> <pattern>%date [%thread] %-5level %logger{80} - %msg%n</pattern> </encoder> </appender> <!-- 时间滚动输出 level为 ERROR 日志 --> <appender name="file-error" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.LevelFilter"> <level>ERROR</level> <onMatch>ACCEPT</onMatch> <onMismatch>DENY </onMismatch> </filter> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern>/cloudCang_log/cloudCang-mgr/cloudCang-mgr_error.%d{yyyy-MM-dd}.log</FileNamePattern> <MaxHistory>30</MaxHistory> </rollingPolicy> <encoder> <pattern>%date [%thread] %-5level %logger{80} - %msg%n</pattern> </encoder> </appender> <root level="debug"> <appender-ref ref="stdout" /> <appender-ref ref="file-debug" /> <appender-ref ref="file-info" /> <appender-ref ref="file-error" /> </root> <logger name="org.mybatis.spring" level="debug" /> <logger name="java.sql.Connection" level="debug" /> <logger name="java.sql.PreparedStatement" level="debug" /> <logger name="org.springframework" level="info" /> <logger name="com.cloud.cang.security" level="warn" /> <logger name="org.apache.zookeeper" level="warn" /> <logger name="com.cloud.cang" level="debug" /> </configuration>