|
@ -27,6 +27,29 @@ |
|
|
</encoder> |
|
|
</encoder> |
|
|
</appender> |
|
|
</appender> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 系统日志输出 --> |
|
|
|
|
|
<appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|
|
|
|
|
<file>${log.path}/sys-debug.log</file> |
|
|
|
|
|
<!-- 循环政策:基于时间创建日志文件 --> |
|
|
|
|
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|
|
|
|
|
<!-- 日志文件名格式 --> |
|
|
|
|
|
<fileNamePattern>${log.path}/sys-debug.%d{yyyy-MM-dd}.log</fileNamePattern> |
|
|
|
|
|
<!-- 日志最大的历史 7天 --> |
|
|
|
|
|
<maxHistory>7</maxHistory> |
|
|
|
|
|
</rollingPolicy> |
|
|
|
|
|
<encoder> |
|
|
|
|
|
<pattern>${log.pattern}</pattern> |
|
|
|
|
|
</encoder> |
|
|
|
|
|
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|
|
|
|
|
<!-- 过滤的级别 --> |
|
|
|
|
|
<level>DEBUG</level> |
|
|
|
|
|
<!-- 匹配时的操作:接收(记录) --> |
|
|
|
|
|
<onMatch>ACCEPT</onMatch> |
|
|
|
|
|
<!-- 不匹配时的操作:拒绝(不记录) --> |
|
|
|
|
|
<onMismatch>DENY</onMismatch> |
|
|
|
|
|
</filter> |
|
|
|
|
|
</appender> |
|
|
|
|
|
|
|
|
<!-- 系统日志输出 --> |
|
|
<!-- 系统日志输出 --> |
|
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|
|
<file>${log.path}/sys-info.log</file> |
|
|
<file>${log.path}/sys-info.log</file> |
|
@ -34,8 +57,8 @@ |
|
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|
|
<!-- 日志文件名格式 --> |
|
|
<!-- 日志文件名格式 --> |
|
|
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern> |
|
|
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern> |
|
|
<!-- 日志最大的历史 60天 --> |
|
|
<!-- 日志最大的历史 7天 --> |
|
|
<maxHistory>60</maxHistory> |
|
|
<maxHistory>7</maxHistory> |
|
|
</rollingPolicy> |
|
|
</rollingPolicy> |
|
|
<encoder> |
|
|
<encoder> |
|
|
<pattern>${log.pattern}</pattern> |
|
|
<pattern>${log.pattern}</pattern> |
|
@ -50,21 +73,22 @@ |
|
|
</filter> |
|
|
</filter> |
|
|
</appender> |
|
|
</appender> |
|
|
|
|
|
|
|
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|
|
<!-- 系统日志输出 --> |
|
|
<file>${log.path}/sys-error.log</file> |
|
|
<appender name="file_warn" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|
|
|
|
|
<file>${log.path}/sys-warn.log</file> |
|
|
<!-- 循环政策:基于时间创建日志文件 --> |
|
|
<!-- 循环政策:基于时间创建日志文件 --> |
|
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|
|
<!-- 日志文件名格式 --> |
|
|
<!-- 日志文件名格式 --> |
|
|
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern> |
|
|
<fileNamePattern>${log.path}/sys-warn.%d{yyyy-MM-dd}.log</fileNamePattern> |
|
|
<!-- 日志最大的历史 60天 --> |
|
|
<!-- 日志最大的历史 7天 --> |
|
|
<maxHistory>60</maxHistory> |
|
|
<maxHistory>7</maxHistory> |
|
|
</rollingPolicy> |
|
|
</rollingPolicy> |
|
|
<encoder> |
|
|
<encoder> |
|
|
<pattern>${log.pattern}</pattern> |
|
|
<pattern>${log.pattern}</pattern> |
|
|
</encoder> |
|
|
</encoder> |
|
|
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|
|
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|
|
<!-- 过滤的级别 --> |
|
|
<!-- 过滤的级别 --> |
|
|
<level>ERROR</level> |
|
|
<level>WARN</level> |
|
|
<!-- 匹配时的操作:接收(记录) --> |
|
|
<!-- 匹配时的操作:接收(记录) --> |
|
|
<onMatch>ACCEPT</onMatch> |
|
|
<onMatch>ACCEPT</onMatch> |
|
|
<!-- 不匹配时的操作:拒绝(不记录) --> |
|
|
<!-- 不匹配时的操作:拒绝(不记录) --> |
|
@ -72,37 +96,68 @@ |
|
|
</filter> |
|
|
</filter> |
|
|
</appender> |
|
|
</appender> |
|
|
|
|
|
|
|
|
<!-- 用户访问日志输出 --> |
|
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|
|
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|
|
<file>${log.path}/sys-error.log</file> |
|
|
<file>${log.path}/sys-user.log</file> |
|
|
<!-- 循环政策:基于时间创建日志文件 --> |
|
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|
|
<!-- 按天回滚 daily --> |
|
|
<!-- 日志文件名格式 --> |
|
|
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern> |
|
|
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern> |
|
|
<!-- 日志最大的历史 60天 --> |
|
|
<!-- 日志最大的历史 7天 --> |
|
|
<maxHistory>60</maxHistory> |
|
|
<maxHistory>7</maxHistory> |
|
|
</rollingPolicy> |
|
|
</rollingPolicy> |
|
|
<encoder> |
|
|
<encoder> |
|
|
<pattern>${log.pattern}</pattern> |
|
|
<pattern>${log.pattern}</pattern> |
|
|
</encoder> |
|
|
</encoder> |
|
|
|
|
|
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|
|
|
|
|
<!-- 过滤的级别 --> |
|
|
|
|
|
<level>ERROR</level> |
|
|
|
|
|
<!-- 匹配时的操作:接收(记录) --> |
|
|
|
|
|
<onMatch>ACCEPT</onMatch> |
|
|
|
|
|
<!-- 不匹配时的操作:接收(记录) --> |
|
|
|
|
|
<onMismatch>DENY</onMismatch> |
|
|
|
|
|
</filter> |
|
|
</appender> |
|
|
</appender> |
|
|
|
|
|
|
|
|
<!-- 系统模块日志级别控制 --> |
|
|
<!-- dev环境 --> |
|
|
<logger name="com.win" level="info" /> |
|
|
<springProfile name="local,dev,default"> |
|
|
<!-- Spring日志级别控制 --> |
|
|
<root level="DEBUG"> |
|
|
<logger name="org.springframework" level="warn" /> |
|
|
<appender-ref ref="console"/> |
|
|
|
|
|
<appender-ref ref="file_debug"/> |
|
|
<root level="error"> |
|
|
<appender-ref ref="file_info"/> |
|
|
<appender-ref ref="console" /> |
|
|
<appender-ref ref="file_warn"/> |
|
|
|
|
|
<appender-ref ref="file_error"/> |
|
|
</root> |
|
|
</root> |
|
|
|
|
|
</springProfile> |
|
|
<!--系统操作日志--> |
|
|
<!-- test环境 --> |
|
|
<root level="info"> |
|
|
<springProfile name="test"> |
|
|
<appender-ref ref="file_info" /> |
|
|
<root level="INFO"> |
|
|
<appender-ref ref="file_error" /> |
|
|
<appender-ref ref="console"/> |
|
|
|
|
|
<appender-ref ref="file_info"/> |
|
|
|
|
|
<appender-ref ref="file_warn"/> |
|
|
|
|
|
<appender-ref ref="file_error"/> |
|
|
|
|
|
</root> |
|
|
|
|
|
</springProfile> |
|
|
|
|
|
<!-- prod环境 --> |
|
|
|
|
|
<springProfile name="prod"> |
|
|
|
|
|
<root level="INFO"> |
|
|
|
|
|
<appender-ref ref="file_info"/> |
|
|
|
|
|
<appender-ref ref="file_warn"/> |
|
|
|
|
|
<appender-ref ref="file_error"/> |
|
|
</root> |
|
|
</root> |
|
|
|
|
|
</springProfile> |
|
|
|
|
|
<!-- 指定第三方日志级别 --> |
|
|
|
|
|
<logger name="org.springframework" level="WARN" /> |
|
|
|
|
|
<logger name="org.apache" level="INFO" /> |
|
|
|
|
|
<logger name="com.baomidou" level="INFO" /> |
|
|
|
|
|
<logger name="org.mybatis" level="INFO" /> |
|
|
|
|
|
<logger name="org.hibernate" level="INFO" /> |
|
|
|
|
|
<logger name="com.win.module.eam.controller" level="INFO" /> |
|
|
|
|
|
<logger name="io.netty" level="WARN" /> |
|
|
|
|
|
<logger name="org.redisson" level="WARN" /> |
|
|
|
|
|
<logger name="org.mapstruct" level="WARN" /> |
|
|
|
|
|
<logger name="org.flowable" level="WARN" /> |
|
|
|
|
|
<logger name="reactor.netty" level="WARN" /> |
|
|
|
|
|
<logger name="de.codecentric.boot" level="WARN" /> |
|
|
|
|
|
<logger name="com.alibaba" level="WARN" /> |
|
|
|
|
|
|
|
|
<!--系统用户操作日志--> |
|
|
|
|
|
<logger name="sys-user" level="info"> |
|
|
|
|
|
<appender-ref ref="sys-user"/> |
|
|
|
|
|
</logger> |
|
|
|
|
|
</configuration> |
|
|
</configuration> |