嗨,我正在使用 Log4j 进行日志记录。下面是我的配置。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true"
xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="FileAppender_Comp3" class="org.apache.log4j.rolling.RollingFileAppender">
<rollingPolicy name="file" class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
<param name="FileNamePattern" value="log/Comp3_%d{dd-MM-yyyy HH-mm-ss}.log" />
</rollingPolicy>
<triggeringPolicy class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
<param name="MaxFileSize" value="3kb"/>
</triggeringPolicy>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %5p [%t] %c (%F:%L) - %m%n"/>
</layout>
</appender>
但是当我运行文件时,它会抛出错误。
log4j:WARN Failed to set property [maxFileSize] to value "3kb".
我怎样才能解决这个问题。请帮我。