<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd" > <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> <param name="encoding" value="UTF-8" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-d{yyyy-MM-dd HH:mm:ss}--%p %l%n %m%n"/> </layout> <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="LevelMax" value="ERROR" /> <param name="LevelMin" value="DEBUG" /> <param name="AcceptOnMatch" value="true" /> </filter> </appender> <appender name="INFO" class="org.apache.log4j.DailyRollingFileAppender"> <param name="encoding" value="UTF-8" /> <param name="DatePattern" value="'_'yyyy-MM-dd'.log'"/> <param name="File" value="/log/xxx.log"/> <param name="Append" value="true"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-d{yyyy-MM-dd HH:mm:ss}--%p %l%n %m%n"/> </layout> <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="LevelMax" value="INFO" /> <param name="LevelMin" value="INFO" /> </filter> </appender> <appender name="ERROR" class="org.apache.log4j.DailyRollingFileAppender"> <param name="encoding" value="UTF-8" /> <param name="DatePattern" value="'_'yyyy-MM-dd'.log'"/> <param name="File" value="/log/xxx.log"/> <param name="Append" value="true"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-d{yyyy-MM-dd HH:mm:ss}--%p %l%n %m%n"/> </layout> <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="LevelMax" value="ERROR" /> <param name="LevelMin" value="WARN" /> </filter> </appender> <category name="org.springframework"> <priority value="error" /> <appender-ref ref="CONSOLE" /> <appender-ref ref="ERROR" /> </category> <logger name="com.xxxx.data.mapper.xxxtMapper.updateCart"> <level value="DEBUG"></level> <appender-ref ref="CONSOLE"/> </logger> <root> <appender-ref ref="CONSOLE"/> <appender-ref ref="INFO"/> <appender-ref ref="ERROR"/> </root> </log4j:configuration>
相关问题
- convert logback.xml to log4j.properties
- logging static methods in a parent class
- Wrap log4j or create custom logger?
- ClassNotFoundException found in Log4j 2.0
- Undeploying a Grails App from Glassfish gets a Cla
相关文章
- Can IntelliJ create hyperlinks to the source code
- how can I disable output to log4j.rootLogger?
- Log4j2 using {} against using %d or %s
- How do I redirect a javaw.exe console output to a
- log4j: Standard way to prevent repetitive log mess
- Log4j2 not working in WebLogic 12.2.1
- Grails and Log4J : How to logs in different files
- Managing a Large Number of Log Files Distributed O
idea的其他地方也需要设置utf-8
https://www.cnblogs.com/liaoyanglong/p/6639039.html 有的设置过tomcat,可以参考