目前我正在将log4j版本从1.2.17升级到2.8.2,为此我需要配置log4j2.xml,如何将下面提到的log4j.xml文件转换为log4j2.xml?
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.SimpleLayout" />
</appender>
<appender name="RootFileAppender" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="logs/webuif.log" />
<param name="MaxFileSize" value="10MB" />
<param name="MaxBackupIndex" value="10" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%p %c: %m%n" />
</layout>
</appender>
<appender name="ApplicationFileAppender" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="logs/ab.log" />
<param name="MaxFileSize" value="10MB" />
<param name="MaxBackupIndex" value="10" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%p %c: %m%n" />
</layout>
</appender>
<category name="com.abc" additivity="false">
<priority value="debug" />
<appender-ref ref="ApplicationFileAppender" />
<appender-ref ref="ConsoleAppender" />
</category>
<root>
<priority value="warn" />
<appender-ref ref="ConsoleAppender" />
<appender-ref ref="RootFileAppender" />
</root>
</log4j:configuration>