You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Nishantha Pradeep <ma...@gmail.com> on 2014/04/17 12:26:00 UTC

Clarification on log file renaming capability.

Hi All

Consider following scenario

1) Application is writing to exception.current log file which has time
based rolling policy.
2) Once the rolling interval passed, exception.current should be renamed to
exception.04042014 and new exception.current file should be started.

Is there any configuration to remove 'current' from rolled out file ?

If is it is not in legacy log4j, will it be available in log4j2 ?

-Thanks
Nishantha

Re: Clarification on log file renaming capability.

Posted by Remko Popma <re...@gmail.com>.
Can't both log4j and log4j2 already do this?

In your config, specify fileName="exception.current" and filePattern="exception.%d{MMddyyyy}".  See the example config for RollingAppender 
http://logging.apache.org/log4j/2.x/manual/appenders.html#RollingFileAppender

Regards,
Remko

Sent from my iPhone

> On 2014/04/17, at 19:26, Nishantha Pradeep <ma...@gmail.com> wrote:
> 
> Hi All
> 
> Consider following scenario
> 
> 1) Application is writing to exception.current log file which has time based rolling policy.
> 2) Once the rolling interval passed, exception.current should be renamed to exception.04042014 and new exception.current file should be started.
> 
> Is there any configuration to remove 'current' from rolled out file ?
> 
> If is it is not in legacy log4j, will it be available in log4j2 ?
> 
> -Thanks
> Nishantha

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org