标签:输出 code count filter class pat core ssi back
新建logback-spring.xml,内容如下:
<?xml version="1.0" encoding="UTF-8"?> <configuration scan="true" scanPeriod="60 seconds"> <property name="ENCODER_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{80} - %msg%n"/> <contextName>scfs-account</contextName> <property name="LOG_HOME" value="D://log" /> <!--设置系统日志目录--> <property name="APPDIR" value="logs" /> <!-- 控制台日志:输出全部日志到控制台 --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <Pattern>${ENCODER_PATTERN}</Pattern> </encoder> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> <level>debug</level> </filter> </appender> <!-- 文件日志:输出全部日志到文件 --> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>${LOG_HOME}/%d{yyyy-MM-dd}.log</fileNamePattern> <maxHistory>30</maxHistory> </rollingPolicy> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <pattern>${ENCODER_PATTERN}</pattern> </encoder> </appender> <springProfile name="test,pro"> <root level="INFO"> <appender-ref ref="FILE"/> </root> </springProfile> <springProfile name="dev"> <root level="INFO"> <appender-ref ref="STDOUT"/> </root> </springProfile> </configuration>
标签:输出 code count filter class pat core ssi back
原文地址:https://www.cnblogs.com/zhuyuehua/p/9648107.html