Microsoft Enterprise Looging Application block

R

Rahul

Hi,

I am using Microsoft Enterprise Logging Application block. I am using a flat
file listener to log the exceptions. Now the problem I am having is that the
log file is becoming too big. What are the options that I have to handle
this problem.

1) I could run a scheduler to periodically archive the log file, but when
IIS is running I am unable to do that as it gives an exception that the file
is being used by another program.

2) I could modify the code in the application block to append the date to
the log file. But the name of the file will only get changed when the
application pool recycles or if the IIS is restarted.

What other options do I have.

Thanks
Rahul
 
J

Joerg Jooss

Thus wrote Rahul,
Hi,

I am using Microsoft Enterprise Logging Application block. I am using
a flat file listener to log the exceptions. Now the problem I am
having is that the log file is becoming too big. What are the options
that I have to handle this problem.

1) I could run a scheduler to periodically archive the log file, but
when IIS is running I am unable to do that as it gives an exception
that the file is being used by another program.

2) I could modify the code in the application block to append the date
to the log file. But the name of the file will only get changed when
the application pool recycles or if the IIS is restarted.

Use a rolling log file appender, that creates a new file after a certain
time span or after a certain file size has been reached.
There are several implementations available, e.g. at http://www.gotdotnet.com

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top