I am working on an application which uses log4net extensivly. I have noticed that once the log file gets to big it starts out with .log, .log.1 , .log.2 , .log.3 , and so on. How do i get it to just say .log and not .log.X .
Asked
Active
Viewed 764 times
0
-
1You should check out this setting: PreserveLogFileNameExtension. Please note that as of Sep 29, 11, you'll need to download and build the latest source. See http://stackoverflow.com/questions/6643759/rollingfileappender-preserve-the-file-extension-without-log4net-patch – Darren Griffith Sep 29 '11 at 19:01
-
possible duplicate of [log4net rolling file appender file name format when maximumFileSize reached](http://stackoverflow.com/questions/11503784/log4net-rolling-file-appender-file-name-format-when-maximumfilesize-reached) – C. Ross Jan 14 '13 at 18:12
1 Answers
3
It looks like the log is configured to use a RollingFileAppender. That keeps log files until a configured maximum size is hit. The log is saved with the .1, .2, etc. extensions and a new one is created.
If you want to just keep appending, try looking at the FileAppender.
Here's a link to some config examples. http://logging.apache.org/log4net/release/config-examples.html

Eric Olsson
- 4,805
- 32
- 35