The RollingFileAppender does not currently support patterns for the
numeric file extensions. The rolled file number must be the last part of
the filename for the appender to identify it.


If anyone wants to try to implement this enhancement I think it should
be relatively straight forward. The Int32.ToString supports patterns,
for example:

7.ToString("000'.txt'") -> "007.txt"

So it should be simple enough to add a number pattern property and then
use that to expand the numeric value into the file name string when
opening the file or when searching for the existing files.

Cheers,
Nicko

> -----Original Message-----
> From: Secules, Christopher T [AMSRD-AAR-AEF-A] 
> [mailto:[EMAIL PROTECTED] 
> Sent: 15 November 2005 15:54
> To: '[email protected]'
> Subject: Question about RollingFileAppender output ending in 
> a txt extension?
> 
> I've tried playing around with my config file wrt log file 
> names, and I can't seem to get what I'm looking for.  I am 
> wondering if there is a way to have the output from the 
> RollingFileAppender save all the log files as text files 
> (.txt).  I've noticed that if I specify just a date pattern 
> in the DatePattern parameter, the resulting log files I get are named:
> 
> Server-2005-11-15
> Server-2005-11-15.1
> Server-2005-11-15.2
> Server-2005-11-15.3
> Server-2005-11-15.4
> Server-2005-11-15.5
> And so on... 
> 
> I'm looking for something like: 
> 
> Server-2005-11-15.txt
> Server-2005-11-15.1.txt
> Server-2005-11-15.2.txt
> Server-2005-11-15.3.txt
> Server-2005-11-15.4.txt
> Server-2005-11-15.5.txt
> And so on...so that the default program to open it is 
> something like Notepad, and not "Unknown Application" 
> 
> Does anyone know of any way to do this, preferrably without 
> extending the source code and just using the pre-packaged log4net.dll?
> 
> Thanks a lot! 
> Chris 
> 
> 

Reply via email to