Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

log4j:WARN Unrecognized element rollingPolicy

Tags:

slf4j

log4j

I had this warning in log when my application was starting

log4j:WARN Unrecognized element rollingPolicy

tried to Google for answers, but adding apache-log4j-extras-1.1.jar didn't helped me.

I'm using slf4j-log4j12 1.7.2 with log4j 1.2.17.

like image 766
Betlista Avatar asked Sep 20 '13 15:09

Betlista


2 Answers

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>
like image 65
Betlista Avatar answered Nov 09 '22 04:11

Betlista


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.

like image 32
kellogs Avatar answered Nov 09 '22 05:11

kellogs