-tree.1.0.0.source-code.log4j.xml Maven / Gradle / Ivy
<?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <appender name="myConsole" class="org.apache.log4j.ConsoleAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="[%d{dd HH:mm:ss,SSS\} %-5p] [%t] %c{2\} - %m%n" /> </layout> <!--过滤器设置输出的级别 --> <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="levelMin" value="${log.level.min}" /> <param name="levelMax" value="${log.level.max}" /> <param name="AcceptOnMatch" value="true" /> </filter> </appender> <appender name="myFile" class="org.apache.log4j.RollingFileAppender"> <param name="File" value="${log.file}" /> <!-- 设置日志输出文件名 --> <param name="Append" value="true" /> <param name="MaxBackupIndex" value="10" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="[%d{dd HH:mm:ss,SSS\} %-5p] [%t] %c{2\} - %m%n" /> </layout> <!--过滤器设置输出的级别 --> <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="levelMin" value="${log.level.min}" /> <param name="levelMax" value="${log.level.max}" /> </filter> </appender> <!-- 根logger的设置 --> <root> <level value="${log.level.min}" /> <appender-ref ref="myConsole" /> <appender-ref ref="myFile" /> </root> </log4j:configuration>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy