Export to GitHub

elmah - issue #58

Log to secondary when primary is not available


Posted on Apr 17, 2008 by Happy Hippo

What steps will reproduce the problem? 1. Configure SQL logging. 2. SQL Connectivity issues (ie.wrong conn.str.) 3. No errors log.

It would be nice to be able to configure secondary log.

Comment #1

Posted on Apr 17, 2008 by Massive Ox

(No comment was entered for this change.)

Comment #2

Posted on Apr 17, 2008 by Massive Ox

This problem is better resolved by setting up error logging and e-mail reporting. If error logging fails then usually SMTP will be working and at least one will get an e- mail. If the infrastructure is experiencing SQL and SMTP connectivity issues, both at the same time, then it should warrant a look into the infrastructure problem. Adding a secondary logging mechanism won't help much more. Don't you think? Creating fallback logging is not difficult, but the bigger problem is getting to those errors back into the log view. Which one do you show? Primary, secondary, both? Would you agree that the best way to resolve this would be to simply send the exception to the currently configured trace listeners? That way, one can use the existing tracing infrastructure as a fallback, which supports an array of listeners and has a viewing facility available via trace.axd.

Comment #3

Posted on Apr 29, 2009 by Swift Kangaroo

I like the orginal poster's idea.

For example, maybe I would like Elmah to...

1st try to log to SqlServer 2nd try to log to XmlFile 3rd try to log to EventLog

...maybe.

EventLog is a good catch-all because it is always up or the machine is toast.

Just my 2-cents.

-- Mark Kamoski

Comment #4

Posted on Dec 1, 2010 by Quick Ox

I'm just beginning with ELMAH (and I have to say it's great!). But most of our problems lately have been with not getting a connection to Oracle, so obviously I can't write the error log to Oracle if I can't get a connection. So, my preference would be to filter the errors by type, and send the Oracle errors to the XML log, and the Non-Oracle errors to Oracle, with the log view pulling from both the XML and from Oracle (if possible, assuming Oracle is up and working).

Comment #5

Posted on Feb 5, 2013 by Happy Giraffe

I released a composite errorlog which address exactly this issue. You can install it via Nuget or copy it from sources into your projects.

Nuget package: http://nuget.org/packages/Elmah.FallbackErrorLog/ sources on Github: https://github.com/eric-b/Elmah.FallbackErrorLog/

Let me know if you have trouble using it. Feel free to merge it into core Elmah if it can resolve this issue.

Comment #6

Posted on Aug 25, 2015 by Massive Ox

This issue has been migrated to: https://github.com/elmah/Elmah/issues/58 The conversation continues there. DO NOT post any further comments to the issue tracker on Google Code as it is shutting down. You can also just subscribe to the issue on GitHub to receive notifications of any further development.

Status: New

Labels:
Type-Enhancement Priority-Low Component-Logic Component-Persistence