<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">java
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="[SKG.com] %-d{yyyy-MM-dd HH:mm:ss} %p [%t] %c{1}.%M(%L) | %m%n"/>
</layout>
</appender>
<appender name="APPLOGFILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/web/logs/ehrweb/skg-platform.log"/>
<!-- 重啓了服務器以後,是否在原有文件的後面追加?true(默認):追加;false:不追加 -->
<param name="Append" value="true"/>
<!-- 最大文件的size,單位:Kb,Mb... -->
<!--<param name="MaxFileSize" value="50MB"/>-->
<!-- 默認 MaxBackupIndex 爲 1 -->
<!--<param name="MaxBackupIndex" value="1" />-->
<param name="Encoding" value="utf-8"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[SKG.com] %-d{yyyy-MM-dd HH:mm:ss} %-5p %-15c{1}: %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="DEBUG" />
<param name="LevelMax" value="ERROR" />
</filter>
</appender>
<appender name="DEBUG" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/web/logs/ehrweb/debug.log"/>web
<!-- 每小時1個文件 -->
<param name="DatePattern" value="'.'yyyy-MM-dd-HH'.log'" />
<!-- 最大文件的size,單位:Kb,Mb... -->
<!--<param name="MaxFileSize" value="50MB" />-->
<!-- 重啓了服務器以後,是否在原有文件的後面追加?true(默認):追加;false:不追加 -->
<param name="Append" value="true"/>
<param name="Encoding" value="utf-8"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[SKG.com] %-d{yyyy-MM-dd HH:mm:ss} %-5p %-15c{1}: %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="DEBUG" />
<param name="LevelMax" value="DEBUG" />
</filter>
</appender>
<appender name="INFO" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/web/logs/ehrweb/info.log"/>
<param name="Append" value="true"/>
<param name="Encoding" value="utf-8"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[SKG.com] %-d{yyyy-MM-dd HH:mm:ss} %-5p %-15c{1}: %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="INFO" />
<param name="LevelMax" value="INFO" />
</filter>
</appender>
<appender name="WARN" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/web/logs/ehrweb/warn.log"/>
<param name="Append" value="true"/>
<param name="Encoding" value="utf-8"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[SKG.com] %-d{yyyy-MM-dd HH:mm:ss} %-5p %-15c{1}: %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="WARN" />
<param name="LevelMax" value="WARN" />
</filter>
</appender>
<appender name="ERROR" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/web/logs/ehrweb/error.log"/>
<param name="Append" value="true"/>
<param name="Encoding" value="utf-8"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[SKG.com] %-d{yyyy-MM-dd HH:mm:ss} %-5p %-15c{1}: %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="ERROR" />
<param name="LevelMax" value="ERROR" />
</filter>
</appender>
<logger name="java.sql.Connection">
<level value="DEBUG"/>
</logger>
<logger name="java.sql.Statement">
<level value="DEBUG"/>
</logger>
<logger name="java.sql.PreparedStatement">
<level value="DEBUG"/>
</logger>
<logger name="com.ibatis">
<level value="DEBUG"/>
</logger>
<logger name="com.ibatis.common.jdbc.SimpleDataSource">
<level value="WARN"/>
</logger>
<logger name="com.ibatis.common.jdbc.ScriptRunner">
<level value="WARN"/>
</logger>
<logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate">
<level value="WARN"/>
</logger>
<logger name="org.springframework.jdbc">
<level value="DEBUG"/>
</logger>
<logger name="java.sql.ResultSet">
<level value="WARN"/>
</logger>
<logger name="java.sql">
<level value="DEBUG" />
</logger>
<logger name="org.apache.ibatis">
<level value="DEBUG" />
</logger>
<logger name="org.mybatis">
<level value="DEBUG" />
</logger>
<logger name="org.mybatis.spring">
<level value="DEBUG" />
</logger>spring
<!-- Suppress success logging from InteractiveAuthenticationSuccessEvent -->
<logger name="org.springframework.security">
<level value="ERROR"/>
</logger>sql
<logger name="org.apache">
<level value="WARN"/>
</logger>
<logger name="com.skg.web.servlet.SpringMvcServlet">
<level value="ERROR" />
</logger>
<logger name="org.springframework.security">
<level value="ERROR"/>
</logger>
<logger name="org.springframework">
<level value="WARN"/>
</logger>
<logger name="org.displaytag">
<level value="ERROR"/>
</logger>
<logger name="com.skg">
<level value="DEBUG"/>
</logger>apache
<logger name="org.activiti">
<level value="WARN"/>
</logger>服務器
<logger name="org.springframework.transaction">
<level value="WARN"/>
</logger>
<logger name="org.apache.catalina">
<level value="WARN"/>
</logger>mybatis
<logger name="org.quartz">
<level value="WARN"/>
</logger>
<!--
root的做用(至關於全局的意思):
1.[priority ]:指定默認的全局輸出級別
2.[appender-ref ]:指定一些默認的append(沒有指出特殊包或者類,即那些沒有指定<logger>元素的append)的輸出;
-->
<root>
<priority value="debug"/>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="APPLOGFILE"/>
<appender-ref ref="DEBUG"/>
<appender-ref ref="INFO"/>
<appender-ref ref="WARN"/>
<appender-ref ref="ERROR"/>
</root>app
</log4j:configuration>
debug