I am testing ELMAH and also have deliberately switched from the database connection for that ELMAH sign in my application to determine what's going to take place in production when the DB is not available.

It appears that ELMAH can't trap its very own errors- the AXD file is not available once the SQL databse log fails.

What's the intended behavior of ELMAH when the database is not available?

How do i identify my errors if the happens?

It appears that ELMAH can't trap its very own errors

ELMAH does trap its very own errors to some degree. When the ErrorLogModule encounters the best while trying to log the mistake then your exception caused by logging is distributed towards the standard .Internet Framework trace facility. See line 123 from 1. sources. See also the next walk-through in the ASP.Internet documentation to get the conventional .Internet Framework tracing dealing with ASP.Internet tracing:

Walkthrough: Integrating ASP.Internet Tracing with System.Diagnostics Tracing

the AXD file is not available once the SQL databse log fails.

That's correct. SQL Server database connectivity should be functional to see errors saved inside a SQL Server database when utilizing SqlErrorLog.

What's the intended behavior of ELMAH when the database is not available?

If, for instance, the SQL Server database is lower, a SqlException will occur throughout logging. ELMAH will send the SqlException object content towards the standard .Internet Framework trace facility.

How do i identify my errors if the happens?

The best choice here's also to enable logging and e-mailing of errors. When the database is lower, odds are good the mail gateway expires and you'll get informed of errors. The errors will, essentially, get drenched in certain mailbox(es). This has got the power when the mail gateway is ever lower then odds are the database is going to be up and errors can get drenched there. If both of them are lower, however, then you will have to seriously take a look at production infrastructure and perhaps take measures for monitoring health of the system via additional measures.

You could make use of the xml file choice to log your errors.

Not necessarily sure about ELMAH but expected behavior of these logging frameworks isn't to throw any exceptions if something wrong happens together. I.e. if ELMAH's database is lower I'd assume it'll simply not log the errors to database.

As recommended above you are able toOrought to use alternative sinks - email or flat file.

I believe you are mixing up contexts a little.

ELMAH's behavior when the database is not available would be to not log errors towards the database. If the exception is tossed around the server or you raise the best with an ErrorSignal, ELMAH will allow that to exception go through either to a yellow screen or perhaps a custom errors page (your setting.)

Since Errors.axd page is just available to individuals that needs to be seeing it (ideally,) it's okay to provide that error towards the user.

The end result is when the errors database is lower you cannot identify errors. For all of us, in the event that were the situation, we'd have bigger problems because the error database sits using the production database.


I'd also advocate against using XML logging for the primary logging source. SQL server will provide you with the best performance without needing to manage the files. With XML logging that's not the situation.