feat(商城): 代码优化
parent
8bfc592d07
commit
1777b1ccd6
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<springProperty scope="context" name="appName" source="spring.application.name" defaultValue="dev"/>
|
||||
<property name="logPath" value="/home/logs/${appName}"/>
|
||||
<property name="pattern"
|
||||
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{request_id}] [%thread] [%-5level] %logger{36}:%L %M - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<!-- encoder 默认配置为PatternLayoutEncoder -->
|
||||
<encoder>
|
||||
<pattern>${pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- 记录日志到文件 -->
|
||||
<appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${logPath}/info.log</file>
|
||||
<encoder>
|
||||
<pattern>${pattern}</pattern>
|
||||
</encoder>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${logPath}/run.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
</rollingPolicy>
|
||||
<!--<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!– 过滤的级别 –>
|
||||
<level>INFO</level>
|
||||
<!– 匹配时的操作:接收(记录) –>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!– 不匹配时的操作:拒绝(不记录) –>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>-->
|
||||
</appender>
|
||||
<!-- 只记录SQL日志 -->
|
||||
<appender name="SQL" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${logPath}/sql.log</file>
|
||||
<encoder>
|
||||
<pattern>${pattern}</pattern>
|
||||
</encoder>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${logPath}/sql.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
</rollingPolicy>
|
||||
</appender>
|
||||
|
||||
<logger name="org.springframework" level="INFO"/>
|
||||
<logger name="io.lettuce.core" level="INFO"/>
|
||||
<!-- logger为java中的包 -->
|
||||
<logger name="com.wayn.common.core.mapper" level="INFO" activity="false">
|
||||
<appender-ref ref="SQL"/>
|
||||
</logger>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT"/>
|
||||
<appender-ref ref="INFO"/>
|
||||
</root>
|
||||
|
||||
</configuration>
|
Loading…
Reference in New Issue