log4j:WARN Unrecognized element rollingPolicy

孤街醉人 提交于 2019-12-05 12:46:20

Instead of rollingPolicy I used DailyRollingFileAppender and no extras jar is needed.

<appender name="rollingLog" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="File" value="${catalina.home}/logs/rolling.log" />
    <param name="append" value="true" />
    <layout class="org.apache.log4j.PatternLayout"> 
        <param name="ConversionPattern" value="%d{ISO8601} %-5p [%t] [%c] %m%n"/> 
    </layout> 
</appender>

Or you can use the extras but make sure to change log4j.xml appender line to:

<appender name="ROLL" class="org.apache.log4j.rolling.RollingFileAppender">

and do away with it.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!