Hello Pavithra,

The class "org.apache.log4j.rolling.RollingFileAppender" is not part
of the `log4j` artifact, but it is part of `apache-log4j-extras`
(https://mvnrepository.com/artifact/log4j/apache-log4j-extras/1.2.17).

Can you try your original configuration:

On Mon, Feb 21, 2022 at 11:16 AM Kudethur, Pavithra (Enterprise)
<pavithra.kudet...@trellix.com.invalid> wrote:
> <appender name="FILE" class="org.apache.log4j.rolling.RollingFileAppender">
>         <param name="Append" value="true"/>
>         <rollingPolicy 
> class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
>             <param name="FileNamePattern" 
> value="${app.home.dir}/logs/app.log.%i"/>
>             <param name="ActiveFileName" 
> value="${app.home.dir}/logs/app.log"/>
>             <param name="MaxIndex" value="13" />
>         </rollingPolicy>
>         <triggeringPolicy 
> class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
>             <param name="maxFileSize" value="3145728" />
>         </triggeringPolicy>
>         <layout class="org.apache.log4j.PatternLayout">
>             <param name="ConversionPattern" value="%d %-5p [%t] 
> [%X{logCorId}] %c - %m%n"/>
>         </layout>
>     </appender>

using the 2.17.2-SNAPSHOT release of `log4j-1.2-api`, `log4j-core` and
`log4j-api`  *and* the 1.2.17 release of `apache-log4j-extras`? I
tested locally and it worked.

The problem with the configuration above is that under the hood it
will use the original `org.apache.log4j.rolling.RollingFileAppender`
class instead of the more powerful
Log4j 2.x `org.apache.logging.log4j.core.appender.RollingFileAppender`
class. To use the latter you need to switch to a Log4j 2.x
configuration file.

>Issue1: But roll over file name is just having app<Date>.log while we want  
>filename as app.log, app.log.1, app.log.2…

This was a bug in 2.17.1.

Regards,
Piotr

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to