Why would one use ELMAH if the application is using NLog

后端 未结 2 1295
醉梦人生
醉梦人生 2021-02-07 09:43

I have to write a centralized logging framework.

Basic requirements are:

  • Log exceptions as well as other details if needed to SQL Server DB.
  • If D
2条回答
  •  一生所求
    2021-02-07 10:21

    Elmah is used for handling uncaught exceptions, and is generally a "last line of defense" to be able to identify when things go completely belly up. You can read what it provides on its github page: http://code.google.com/p/elmah/

    NLog and others (I highly recommend Serilog) are used for runtime diagnostics and tracing... That is, to dump information which you are either tracing, or logging (which is, by definition, not uncaught exceptions).

    NLog, as like log4net, nlog is getting quite long in the tooth and while there was a recent release... the previous release a year earlier, and I feel most of the "old guard" logging frameworks have not really grown with the times.

    Serilog is a much better choice, as it provides "structured logging" which allows you to, for example, search on specific fields in the log files.

提交回复
热议问题