开发者

NLog, Elmah + shared library

I am trying to come up with a way to create a commo开发者_如何学运维n library for all my MVC projects. I started off really simple with BaseController and BaseModel classes. Easy stuff!

Now in my projects I would like to either use Elmah or NLog for logging exceptions and/or tracing info.

Can anyone give me some ideas on the best practices for writing a common library to support both?


I would use NLog as base for your logging. I've created a small target for NLog which could be used to route exceptions to ELMA. You'll find it at https://github.com/ccellar/nlog-elmah-target.

With this target you are able to use logger.*Exception( ... ) to log the exception and to pass it to ELMAH.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜