Logging unhandled exceptions using NLog? Should ELMAH and NLog be used together?

I am using ELMAH in my ASP.NET MVC projects and I really like its simplicity. But I needed the ability to log certain events in my code in a log.Info("message") manner. Since ELMAH does not provide that ability I started looking at NLog.

A few questions came to mind:

  1. Is using both ELMAH and NLog overkill? Using ELMAH for unhandled exceptions and NLog for everything else?
  2. Is it possible to configure NLog to log unhandled exceptions in the nlog.config or is custom code needed?
  3. If custom code is needed where would be the best place to add it? The OnException method in the MVC framework? The global.asax file?

Anny feedback is greatly appreciated. So far I haven't found any good posts on this matter?

12
задан Thomas 1 November 2010 в 01:07
поделиться