Browse Source

1.解决日志乱码问题

luxueshi 3 years ago
parent
commit
e6ddff13dc
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/main/resources/log4j.xml

+ 2 - 0
src/main/resources/log4j.xml

@@ -14,6 +14,7 @@
     <appender name="fileAppenderInfo" class="org.apache.log4j.DailyRollingFileAppender">
         <param name="File" value="D:/minitor-logs/info.log" />
         <param name="DatePattern" value=".yyyy-MM-dd" />
+        <param name="encoding" value="UTF-8" />
         <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="[%d{HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
         </layout>
@@ -27,6 +28,7 @@
     <appender name="fileAppenderError" class="org.apache.log4j.DailyRollingFileAppender">
         <param name="File" value="D:/minitor-logs/error.log" />
         <param name="DatePattern" value=".yyyy-MM-dd" />
+        <param name="encoding" value="UTF-8" />
         <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="[%d{HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
         </layout>