Saturday, February 04, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: Rolling logs, one for each run of the application?
Prev Next
You are not authorized to post a reply.

Author Messages
Ted Graham

06/10/2004 10:19 PM  
We need to configure log4net to create a new log file each time our Windows Forms application starts.  It seems like the RollingFileAppender should handle this, but I can't find an example that does this.  The examples I find are all the same, keeping 10 logs of up to 100k each.  Is there a way to configure log4net to create a new file each time the application starts, keeping the most recent 3?  I'd also like to name the log files based on the start time.
 
We're using log4net 1.20-beta 8.
 
Thanks,
Ted
Ted Graham

06/14/2004 3:36 PM  
Is what I want to do possible with log4net?  I've found that log4j has a DailyRollingFileAppender, but it doesn't appear that it was ported to log4net.  Thoughts?  Are the developers still active?
 
Thanks,
Ted
Denis, Rich

06/14/2004 4:46 PM  

The rollinglogfile appender does support rolling on days. But that still wont solve the problem that you were asking about unless that is default behavior for the rolling appender.  I think it just appends to the same file if it is on the same date.  It would be possible to have the app start  write out a parsable string to know where the beginning is then write a console app that tears that into 3 files.  Anyways just throwing that out there.

 

Rich Denis
perotsystems

972.577.5869 Wk
rich.denis@ps.net


Nicko Cadell

06/27/2004 8:13 PM  

Ted,

The RollingFileAppender is not designed to roll one file per run. It is
designed to roll on either date boundaries or on file size during an
application run.

If you need to have a unique file per run then you should subclass the
FileAppender and override the OpenFile method to select the unique name
for the log file for the current execution. You may be able to just use
the process start time to give you a unique name.

Nicko

You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > Rolling logs, one for each run of the application?



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement