Health Monitoring Config Nightmare

A

andrew.douglas11

Hello all,

I've been struggling on something that should be very easy. I want to
log every unhandled exception that occurs in my web app to a text
file. With the introduction of health monitoring in 2.0, this should
be super easy, but it's not. First off, there's no out-of-the-box
provider for logging to a text file which is very strange. Microsoft
at least provides some solutions to this problem on their website. I
have implemented the "SampleBufferedEventProvider" class found at the
following URLs:

Setup/Config: http://msdn2.microsoft.com/en-us/library/ms178718.aspx
Code: http://msdn2.microsoft.com/en-us/library/ms227676.aspx

This code does a good job of providing verbose exception information
and buffering it to a text file. The one major issue with this
provider is that the path to the log file must be hard-coded! If you
try to add a custom attribute to the provider node in Web.config, the
compiler barks at you. So my question is: can I somehow make a change
that will allow me to specify the path to the file or directory to log
to in the Web.config?

I noticed in another Microsoft solution to this issue, the
"TextFileWebEventProvider" DOES have a logFileName attribute in its
Web.config. (http://msdn2.microsoft.com/en-us/library/aa479036.aspx)
Why does this provider get to have a logFileName attribute and the
other doesn't?

Thanks,
Andy
 

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,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top