Question

I can wire up Elmah to log Exceptions in my ASP.Net application and it works well.

I also have a requirement to audit interesting events that occur in the application. For example, I must audit the "email address was changed" event and store the old and new email address.

Is it appropriate to use Elmah to log these interesting events? It doesn't seem like Elmah is configured to log anything beyond exceptions.

I could smush it in there and create a fake Exception, but that smells funny. On the other hand, it seems bad to have multiple log repositories laying around for a small application.

Is it appropriate to use Elmah as an audit repository and create fake exceptions? Can Elmah store "info" items, in addition to exceptions? Is there a better repository for interesting events when I'm already using Elmah?

Was it helpful?

Solution

Definitely don't use ELMAH for auditing. Either build auditing into your business logic or at the very least use something like log4net to log it somewhere else.

OTHER TIPS

I think i'd probably create a sql trigger on the fields you are wanting to audit, you wont have mess about with any other applications then, SQL server will just take care of it all for you

Bumping an old post, but now there's an elmahappender for log4net

This way, you can have all the functionality of log4net, like sending info messages to elmah, and have the nice web interface of elmah to read them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top