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 "Auinger, Thomas" <Th...@wincor-nixdorf.com> on 2002/09/25 11:29:54 UTC

RFE: provide a way to specifiy the names of the RollingFileAppend er's backup files

Hi!

In the current implementation, the RollingFileAppender always
names backup files to "<filename>.1", "<filename>.2" etc.

It would be great, if developers could add their own naming
convention.

This could be done using different ways (I think):

a) The developer sets a naming pattern String as a parameter
to the RollingFileAppender, which defines the filename (similar
to PatternLayout), e.g. "%f.%d.%n", where %f = filename, %d = date,
%n = backupIndex


b) The developer implements an interface, which provides a
single method to generate a filename for a backup file:

 public interface BackupFilenameResolver {
 
 	public String getFilename( int backupIndex );
 
 }

An implementing class name of this interface may then be set
as a parameter to the RollingFileAppender (similar to how
ObjectRenderers are currently configured)


I would prefer soultion (b), since it is more flexible.


Greetings from Germany,
 Thomas

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: provide a way to specifiy the names of the RollingFileAppender's backup files

Posted by mw...@apache.org.
Hi Thomas,

Thanks for posting the suggestion.  I think we need to look at it in the
context of the other RollingFileAppender changes that are being looked at.

Would anyone more familiar with those changes like to talk about them?

-Mark

> -----Original Message-----
> From: Auinger, Thomas [mailto:Thomas.Auinger@wincor-nixdorf.com]
> Sent: Wednesday, September 25, 2002 2:30 AM
> To: 'Log4J Developers List'
> Subject: RFE: provide a way to specifiy the names of the
> RollingFileAppender's backup files
>
>
> Hi!
>
> In the current implementation, the RollingFileAppender always
> names backup files to "<filename>.1", "<filename>.2" etc.
>
> It would be great, if developers could add their own naming
> convention.
>
> This could be done using different ways (I think):
>
> a) The developer sets a naming pattern String as a parameter
> to the RollingFileAppender, which defines the filename (similar
> to PatternLayout), e.g. "%f.%d.%n", where %f = filename, %d = date,
> %n = backupIndex
>
>
> b) The developer implements an interface, which provides a
> single method to generate a filename for a backup file:
>
>  public interface BackupFilenameResolver {
>
>  	public String getFilename( int backupIndex );
>
>  }
>
> An implementing class name of this interface may then be set
> as a parameter to the RollingFileAppender (similar to how
> ObjectRenderers are currently configured)
>
>
> I would prefer soultion (b), since it is more flexible.
>
>
> Greetings from Germany,
>  Thomas
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>