log4j 项目启动的时候出现了警告
这是启动时出现的警告
log4j:WARN Continuable parsing error 75 and column 11
log4j:WARN The content of element type "logger" must match "(level?,appender-ref*)".
log4j:WARN Continuable parsing error 79 and column 11
log4j:WARN The content of element type "logger" must match "(level?,appender-ref*)".
这是我的配置
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm} %-5p [%F:%L] - %m%n" />
</layout>
</appender>
<appender name="FILE" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="../logs/vbrowser_server.log" />
<param name="Append" value="true" />
<param name="MaxFileSize" value="10MB" />
<param name="MaxBackupIndex" value="50" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%F:%L] %m%n" />
</layout>
</appender>
<appender name="request" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="../logs/request/request.log" />
<param name="Append" value="true" />
<param name="DatePattern" value="'.'yyyy-MM-dd'.log'" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%F:%L] %m%n" />
</layout>
</appender>
<appender name="response" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="../logs/response/request.log" />
<param name="Append" value="true" />
<param name="DatePattern" value="'.'yyyy-MM-dd'.log'" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%F:%L] %m%n" />
</layout>
</appender>
<logger name="request" additivity="true">
<priority value="INFO" />
<appender-ref ref="request" />
</logger>
<logger name="response" additivity="true">
<priority value="INFO" />
<appender-ref ref="response" />
</logger>
<root>
<priority value="INFO"/>
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
</root>
各位大虾不知掉啥问题引起的,还请多多指教
------解决方案--------------------
按照字面意思应该是你的 logger节点配置有问题,他需要<level value="ERROR" />这个元素,我大概浏览了下官方的XML配置文件应该是类似这样的
<logger name="response" additivity="true">
<level value="ERROR" />
<appender-ref ref="A1" />
</logger>
你偿试的修改下上面二个logeer的配置信息