日志配置文件
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="10 seconds">
<contextName>demo</contextName>
<property name="log.path" value="logs">
</property>
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
<conversionRule conversionWord="wex"
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%thread]){faint} %clr(%-40.40logger{39}){cyan} %L %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wex}}"/>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<appender name="demo_log" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/demo.log</file>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/demo-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>7</maxHistory>
</rollingPolicy>
</appender>
<appender name="druid_log" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/druid.log</file>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/druid-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>7</maxHistory>
</rollingPolicy>
</appender>
<logger name="org.springframework.scheduling.quartz" level="error" additivity="false"/>
<logger name="cn.leadingtv.patrol.mapper" level="debug" additivity="false">
<appender-ref ref="console"/>
<appender-ref ref="demo_log"/>
</logger>
<logger name="cn.leadingtv.oauth.mapper" level="debug" additivity="false">
<appender-ref ref="console"/>
<appender-ref ref="demo_log"/>
</logger>
<logger name="cn.leadingtv.event.mapper" level="debug" additivity="false">
<appender-ref ref="console"/>
<appender-ref ref="demo_log"/>
</logger>
<logger name="cn.leadingtv.device.mapper" level="debug" additivity="false">
<appender-ref ref="console"/>
<appender-ref ref="demo_log"/>
</logger>
<logger name="cn.leadingtv.map.mapper" level="debug" additivity="false">
<appender-ref ref="console"/>
<appender-ref ref="demo_log"/>
</logger>
<logger name="com.alibaba.druid.sql" level="debug" additivity="false">
<appender-ref ref="druid_log"/>
</logger>
<root level="info">
<appender-ref ref="console"/>
<appender-ref ref="demo_log"/>
</root>
</configuration>