日期:2014-05-20 浏览次数:20869 次
<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE log4j:configuration SYSTEM "./log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <!-- appenders --> <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> <layout class="org.apache.log4j.SimpleLayout" /> </appender> <appender name="FILE" class="org.apache.log4j.RollingFileAppender"> <param name="file" value="C:\\log.log" /> <param name="encoding" value="UTF-8" /> <param name="threshold" value="info" /> <param name="maxFileSize" value="5120KB" /> <param name="maxBackupIndex" value="5" /> <layout class="org.apache.log4j.PatternLayout"> <param name="conversionPattern" value="[%d{yyyy-MM-dd HH:mm:ss}] [%p] [%t] [%c]: %m%n" /> </layout> <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="levelMin" value="WARN" /> <param name="levelMax" value="INFO" /> <param name="AcceptOnMatch" value="true" /> </filter> </appender> <appender name="ERROR" class="org.apache.log4j.RollingFileAppender"> <param name="file" value="C:\\error.log" /> <param name="encoding" value="UTF-8" /> <param name="threshold" value="error" /> <param name="maxFileSize" value="5120KB" /> <param name="maxBackupIndex" value="5" /> <layout class="org.apache.log4j.PatternLayout"> <param name="conversionPattern" value="[%d{yyyy-MM-dd HH:mm:ss}] [%p] [%t] [%c]: %m%n" /> </layout> </appender> <appender name="STAT" class="org.apache.log4j.DailyRollingFileAppender"> <param name="file" value="C:\\stat.log" /> <param name="encoding" value="UTF-8" /> <param name="threshold" value="info" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="[%d{yyyy-MM-dd HH:mm:ss}] [%p]: %m%n" /> </layout> <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="levelMin" value="info" /> <param name="levelMax" value="info" /> <param name="AcceptOnMatch" value="true" /> </filter> </appender> <!-- disable unnecessary logs --> <logger name="org.apache.struts2.dispatcher.multipart.MultiPartRequest" additivity="false"> <level value="fatal" /> <appender-ref ref="ERROR" /> </logger> <logger name="org.apache.struts2.interceptor.FileUploadInterceptor" additivity="false"> <level value="fatal" /> <appender-ref ref="ERROR" /> </logger> <appender name="IBatis" class="org.apache.log4j.ConsoleAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-4r [%t] %-5p %c %x - %m%n" /> </layout> <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="LevelMin" value="DEBUG" /> <param name="LevelMax" value="DEBUG" /> </filter> </appender> <logger name="com.ibatis" additivity="true"> <level value="DEBUG" /> </logger> <logger name="java.sql.Connection" additivity="true"> <level value="DEBUG" /> </logger> <logger name="java.sql.Statement" additivity="true"> <level value="DEBUG" /> </logger> <logger name="java.sql.PreparedStatement" additivity="true"> <level value="DEBUG" /> <appender-ref ref="IBatis" /> </logger> <logger name="java.sql.ResultSet" additivity="true"> <level value="DEBUG" /> <appender-ref ref="IBatis" /> </logger> <!-- root loggers --> <root> <priority value="info" /> <appender-ref ref="CONSOLE" /> <appender-ref ref="FILE" /> <appender-ref ref="ERROR" /> </root> </log4j:configuration>