优化
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,21 +1,43 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration>
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
<include resource="org/springframework/boot/logging/logback/base.xml" />
|
<!-- 日志存放路径 -->
|
||||||
<logger name="org.springframework.web" level="INFO"/>
|
<property name="log.path" value="logs/thxf" />
|
||||||
<logger name="org.springboot.sample" level="TRACE" />
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||||
|
|
||||||
<!-- 开发、测试环境 -->
|
<!-- 控制台输出 -->
|
||||||
<springProfile name="dev,test">
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
<logger name="org.springframework.web" level="INFO"/>
|
<encoder>
|
||||||
<logger name="org.springboot.sample" level="INFO" />
|
<pattern>${log.pattern}</pattern>
|
||||||
<logger name="io.renren" level="DEBUG" />
|
</encoder>
|
||||||
</springProfile>
|
</appender>
|
||||||
|
|
||||||
<!-- 生产环境 -->
|
<!-- 系统日志输出 -->
|
||||||
<springProfile name="prod">
|
<appender name="file_all" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<logger name="org.springframework.web" level="ERROR"/>
|
<file>${log.path}/xf.log</file>
|
||||||
<logger name="org.springboot.sample" level="ERROR" />
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
<logger name="io.renren" level="ERROR" />
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
</springProfile>
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/xf.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="io.renren" level="info" />
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn" />
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_all" />
|
||||||
|
</root>
|
||||||
</configuration>
|
</configuration>
|
||||||
Reference in New Issue
Block a user