New to this block RRS feed

  • Question

  • User1088344998 posted
    I have a couple of quick questions regarding the Exception Management block. 1) Can you have the exceptions logged on a different computer? 2) Can you use this block with a Windows application? 3) Can you have the exceptions logged in the event log or in SQL and also sent via e-mail? 4) Finally, can you tier the exceptions so if your DB is offline it will log in the event viewer instead? Thanks in advance! Jason
    Tuesday, September 21, 2004 3:55 PM

All replies

  • User1089004976 posted

    Hi Jason,

    Well, this post has certainly waited a long time for an answer.  I'd just like to post a reply to hopefully make it useful if somebody else finds it.  I'm sure you've found answers on your since September! :)

    1)  This isn't supported out-of-the-box, but the good news is you can very easily create your own.  What you do in a custom publisher is limited only by .NET itself - you could log to a common file, database, WMI, etc.  In fact, there are plenty of articles out there on how to create custom publishers.  Check out http://aspnet.4guysfromrolla.com/articles/032404-1.aspxhttp://builder.com.com/5100-6374-5110833.html and http://www.developer.com/net/article.php/3102591
    2)  Absolutely.  Any .NET application can use this block, just use the app.config instead of web.config.
    3)  See #1, but also yes, you can easily configure multiple blocks to respond to the same exception.  Just enable both blocks in your config file and ensure they both include the exception type you wish to log (e.g. System.Data.DataException).
    4)  This is actually the default behavior in the EMAB.  If no other publishers succeed, the EMAB resorts to logging the exception with the default (event log) publisher.  You will also see event log entries describing any custom publisher failures.  Because relying on this behavior will lead to extra entries in your event log, in your case from the failing DB publisher, you could make your custom DB publisher have the "smarts" to know the DB is offline and log to the event log (instead of throwing an exception.)


    Monday, June 27, 2005 4:24 PM