zizoovic
zizoovic

Reputation: 1

Cannot configure apache-log4j-extras-1.2.17 with log4j-1.2.17 for time based log rotation and gzipped everyday

please I want a detailed description of all the steps that allows me to add log4j-extras (rolling.TimeBasedRollingPolicy) on log4j !!! I tried several alternatives but all during startup tomcat => dump catalina: log4j: WARN Unrecognized element rollingPolicy

log4j.xml `

    <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
        <param name="FileNamePattern" value="/tmp1/SqlEl.%d{yyyy-MM-dd_HH}.log.gz"/>
        <param name="ActiveFileName" value="/tmp1/SqlEl.log"/>
    </rollingPolicy>
    <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d | -%t | -%x | %m\n"/>           
            </layout>
    </appender>`

thanks in advance

Upvotes: 0

Views: 1120

Answers (1)

TobiSH
TobiSH

Reputation: 2921

From the error message I guess you are using the wrong appender. Please double-check whether you are using org.apache.log4j.rolling.RollingFileAppender and not something like org.apache.log4j.DailyRollingFileAppender.

If that's not the case please submit your entire log4j.xml.

Upvotes: 1

Related Questions