Re: Log Exceptions in a single XML file.

55 views
Skip to first unread message

James_2JS

unread,
Feb 26, 2013, 8:34:30 AM2/26/13
to el...@googlegroups.com
Hi Fahad,

Before I start answering, would you mind explaining why is this causing you an issue??

This is certainly something that you could write your own code for, however, I'm not sure that it's such a wise idea!
Just a couple of things that would concern me with such an implementation would be:

1) Multi-threaded access to the file system - you've got multiple requests coming in together... and a single file in which to store them.
That sounds like a recipe for blocking, and/or synchronisation issues.

2) File size - what happens as the file size starts to grow?
Are you going to run into memory management issues?
You don't want the XML file to reside in memory permanently... but you also don't want to have to load it for each error logged / viewed.
How are you going to trim those logs down - particularly on a live site?

For all of the above, I wouldn't want to even try implementing this in such a way that it is fully supportable by the project team and could be released in any production environment.
If you still want to give it a go, take a look at http://code.google.com/p/elmah/source/browse/src/Elmah/XmlFileErrorLog.cs

Hope this helps!

Cheers,

James

On Tuesday, February 26, 2013 1:11:57 PM UTC, fahhad...@gmail.com wrote:
 ELMAH has some really great magical features,
 but is there any way to log all exceptions in a single XML file rather then generating new files for every single exception that would be caught
or generated over and over again by the user. Kind Regards Fahad
Reply all
Reply to author
Forward
0 new messages