|
@@ -1,23 +1,25 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<configuration scan="true">
|
|
|
|
|
|
- <springProperty scope="context" name="appName" source="spring.application.name"/>
|
|
|
+ <springProperty scope="context" name="appName" source="spring.application.name"/>
|
|
|
|
|
|
|
|
|
<contextName>${appName}</contextName>
|
|
|
<property name="LOG_PATH" value=".logs"/>
|
|
|
|
|
|
- <property name="APPDIR" value="${appName}" />
|
|
|
+ <property name="APPDIR" value="${appName}"/>
|
|
|
|
|
|
|
|
|
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
|
|
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
|
|
<encoder>
|
|
|
|
|
|
|
|
|
- <pattern>1-%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger - %msg%n</pattern>
|
|
|
+ <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger Line:%-3L - %msg%n</pattern>
|
|
|
<charset>UTF-8</charset>
|
|
|
</encoder>
|
|
|
</appender>
|
|
|
+
|
|
|
+
|
|
|
|
|
|
说明:
|
|
|
1、日志级别及文件
|
|
@@ -42,6 +44,7 @@
|
|
|
<file>${LOG_PATH}/${APPDIR}/log_error.log</file>
|
|
|
|
|
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
|
+ <maxHistory>30</maxHistory>
|
|
|
|
|
|
而2013-12-21的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
|
|
<fileNamePattern>${LOG_PATH}/${APPDIR}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
|
@@ -67,19 +70,20 @@
|
|
|
</appender>
|
|
|
|
|
|
|
|
|
- <appender name="FILEWARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
+ <appender name="FILEINFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
|
|
|
- <file>${LOG_PATH}/${APPDIR}/log_warn.log</file>
|
|
|
+ <file>${LOG_PATH}/${APPDIR}/log_info.log</file>
|
|
|
|
|
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
|
|
|
|
而2013-12-21的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
|
|
- <fileNamePattern>${LOG_PATH}/${APPDIR}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
|
|
+ <fileNamePattern>${LOG_PATH}/${APPDIR}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
|
|
|
|
|
命名日志文件,例如log-error-2013-12-21.0.log -->
|
|
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
|
|
<maxFileSize>2MB</maxFileSize>
|
|
|
</timeBasedFileNamingAndTriggeringPolicy>
|
|
|
+ <maxHistory>15</maxHistory>
|
|
|
</rollingPolicy>
|
|
|
|
|
|
<append>true</append>
|
|
@@ -90,21 +94,22 @@
|
|
|
</encoder>
|
|
|
|
|
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
|
|
- <level>warn</level>
|
|
|
+ <level>info</level>
|
|
|
<onMatch>ACCEPT</onMatch>
|
|
|
<onMismatch>DENY</onMismatch>
|
|
|
</filter>
|
|
|
</appender>
|
|
|
|
|
|
|
|
|
- <appender name="FILEINFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
+ <appender name="FILEWARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
|
|
|
- <file>${LOG_PATH}/${APPDIR}/log_info.log</file>
|
|
|
+ <file>${LOG_PATH}/${APPDIR}/log_warn.log</file>
|
|
|
|
|
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
|
|
|
|
而2013-12-21的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
|
|
- <fileNamePattern>${LOG_PATH}/${APPDIR}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
|
|
+ <maxHistory>7</maxHistory>
|
|
|
+ <fileNamePattern>${LOG_PATH}/${APPDIR}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
|
|
|
|
|
命名日志文件,例如log-error-2013-12-21.0.log -->
|
|
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
|
@@ -120,81 +125,55 @@
|
|
|
</encoder>
|
|
|
|
|
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
|
|
- <level>info</level>
|
|
|
+ <level>warn</level>
|
|
|
<onMatch>ACCEPT</onMatch>
|
|
|
<onMismatch>DENY</onMismatch>
|
|
|
</filter>
|
|
|
</appender>
|
|
|
|
|
|
+ <appender name="STDOUT" class="ch.qos.logback.core.FileAppender">
|
|
|
+ <file>${LOG_PATH}/${APPDIR}/log.log</file>
|
|
|
+ <append>false</append>
|
|
|
+ <encoder>
|
|
|
+
|
|
|
+
|
|
|
+ <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger Line:%-3L - %msg%n</pattern>
|
|
|
+ <charset>UTF-8</charset>
|
|
|
+ </encoder>
|
|
|
+ </appender>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<appender name="MQ" class="cn.gygxzc.envir.core.logger.MQAppender">
|
|
|
<sysName>${appName}</sysName>
|
|
|
</appender>
|
|
|
|
|
|
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
|
|
|
- <appender-ref ref ="MQ"/>
|
|
|
+ <appender-ref ref="MQ"/>
|
|
|
</appender>
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
|
|
- <encoder>
|
|
|
- <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger Line:%-3L - %msg%n</pattern>
|
|
|
- </encoder>
|
|
|
- </appender>
|
|
|
-
|
|
|
- <logger name="com.gxzc" level="DEBUG" additivity="true"/>
|
|
|
- <logger name="cn.gygxzc" level="DEBUG"/>
|
|
|
+
|
|
|
+ <logger name="com.gxzc" level="DEBUG" additivity="true">
|
|
|
+ <appender-ref ref="ASYNC"/>
|
|
|
+ </logger>
|
|
|
+ <logger name="cn.gygxzc" level="DEBUG">
|
|
|
+ <appender-ref ref="ASYNC"/>
|
|
|
+ </logger>
|
|
|
+
|
|
|
<logger name="org.springframework.data.mybatis" level="DEBUG"/>
|
|
|
<logger name="org.springframework.aop.aspectj" level="ERROR"/>
|
|
|
|
|
|
<logger name="javax.activation" level="WARN"/>
|
|
|
<logger name="javax.mail" level="WARN"/>
|
|
|
<logger name="javax.xml.bind" level="WARN"/>
|
|
|
- <logger name="ch.qos.logback" level="INFO"/>
|
|
|
- <logger name="com.codahale.metrics" level="WARN"/>
|
|
|
- <logger name="com.ryantenney" level="WARN"/>
|
|
|
- <logger name="com.sun" level="WARN"/>
|
|
|
- <logger name="com.zaxxer" level="WARN"/>
|
|
|
- <logger name="io.undertow" level="WARN"/>
|
|
|
- <logger name="net.sf.ehcache" level="WARN"/>
|
|
|
- <logger name="org.apache" level="WARN"/>
|
|
|
- <logger name="org.apache.catalina.startup.DigesterFactory" level="OFF"/>
|
|
|
- <logger name="org.bson" level="WARN"/>
|
|
|
- <logger name="org.hibernate.validator" level="WARN"/>
|
|
|
- <logger name="org.hibernate" level="WARN"/>
|
|
|
+ <logger name="ch.qos.logback" level="ERROR"/>
|
|
|
+
|
|
|
+
|
|
|
+ <logger name="org.hibernate.validator" level="ERROR"/>
|
|
|
+ <logger name="org.hibernate" level="ERROR"/>
|
|
|
<logger name="org.hibernate.ejb.HibernatePersistence" level="OFF"/>
|
|
|
<logger name="org.springframework.web" level="INFO"/>
|
|
|
- <logger name="org.springframework.security" level="WARN"/>
|
|
|
- <logger name="org.springframework.cache" level="WARN"/>
|
|
|
- <logger name="org.thymeleaf" level="WARN"/>
|
|
|
- <logger name="org.xnio" level="WARN"/>
|
|
|
- <logger name="springfox" level="WARN"/>
|
|
|
- <logger name="sun.rmi" level="WARN"/>
|
|
|
- <logger name="liquibase" level="WARN"/>
|
|
|
- <logger name="sun.rmi.transport" level="WARN"/>
|
|
|
|
|
|
<logger name="jdbc.connection" level="ERROR"/>
|
|
|
<logger name="jdbc.resultset" level="ERROR"/>
|
|
@@ -212,20 +191,17 @@
|
|
|
<appender-ref ref="FILEERROR"/>
|
|
|
<appender-ref ref="FILEWARN"/>
|
|
|
<appender-ref ref="FILEINFO"/>
|
|
|
- <appender-ref ref="DBAPPENDER"/>
|
|
|
- <appender-ref ref="ASYNC"/>
|
|
|
</root>
|
|
|
</springProfile>
|
|
|
|
|
|
|
|
|
<springProfile name="dev">
|
|
|
<root level="INFO">
|
|
|
- <appender-ref ref="STDOUT"/>
|
|
|
<appender-ref ref="CONSOLE"/>
|
|
|
+ <appender-ref ref="STDOUT"/>
|
|
|
<appender-ref ref="FILEERROR"/>
|
|
|
<appender-ref ref="FILEWARN"/>
|
|
|
<appender-ref ref="FILEINFO"/>
|
|
|
- <appender-ref ref="ASYNC"/>
|
|
|
</root>
|
|
|
</springProfile>
|
|
|
|