12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?xml version="1.0" encoding="UTF-8"?>
- <configuration>
- <!--info日志-->
- <springProperty scope="context" name="LOG_HOME" source="logback.file"/>
- <appender name="APP_INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
- <!--活动日志输出路径示例-->
- <file>${LOG_HOME}/info.log</file>
- <append>true</append>
- <!--存档日志示例-->
- <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <fileNamePattern>${LOG_HOME}/%d{yyyy-MM-dd}/info-${HOSTNAME}.%i.log.gz</fileNamePattern>
- <!--日志大小可自定义-->
- <maxFileSize>50MB</maxFileSize>
- <!--存档天数可自定义-->
- <maxHistory>30</maxHistory>
- </rollingPolicy>
- <!--统一日志输出格式-->
- <encoder charset="UTF-8">
- <pattern>%date [%thread] %-5level %logger [%L] - %msg%n</pattern>
- </encoder>
- </appender>
- <!--ERROR日志-->
- <appender name="APP_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${LOG_HOME}/error.log</file>
- <append>true</append>
- <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.SizeAndTimeBasedRollingPolicy">
- <fileNamePattern>${LOG_HOME}/%d{yyyy-MM-dd}/error-${HOSTNAME}.%i.log.gz</fileNamePattern>
- <!--日志大小可自定义-->
- <maxFileSize>50MB</maxFileSize>
- <!--存档天数可自定义-->
- <maxHistory>30</maxHistory>
- </rollingPolicy>
- <encoder charset="UTF-8">
- <pattern>%date [%thread] %-5level %logger [%L] - %msg%n</pattern>
- </encoder>
- </appender>
- <!--<appender name="CatAppender" class="com.kaola.travel.travel.config.CatLogbackAppender"></appender>-->
- <logger name="org.apache.ibatis" level="info" additivity="false">
- <appender-ref ref="APP_INFO"/>
- <appender-ref ref="APP_ERROR"/>
- <!--<appender-ref ref="CatAppender" />-->
- </logger>
- <logger name="com.mofangchuxing.aska" level="INFO" additivity="false">
- <appender-ref ref="APP_INFO"/>
- <appender-ref ref="APP_ERROR"/>
- <!--<appender-ref ref="CatAppender" />-->
- </logger>
- <logger name="com.alibaba.dubbo" level="INFO" additivity="false">
- <appender-ref ref="APP_INFO"/>
- <appender-ref ref="APP_ERROR"/>
- <!--<appender-ref ref="CatAppender" />-->
- </logger>
- <root level="INFO">
- <!--<appender-ref ref="CatAppender" />-->
- <appender-ref ref="APP_INFO"/>
- <appender-ref ref="APP_ERROR"/>
- </root>
- </configuration>
|