What are the best practices for including logging using log4net?

后端 未结 9 994
夕颜
夕颜 2021-02-07 04:04

I have been told to add “logging” to my code using log4net, the problem is no one can travel in time and see what real world problems the logging will need to be used to solve.<

9条回答
  •  时光说笑
    2021-02-07 04:43

    There's probably a better way to do this for WCF; for WinForms, you might consider looking at PostSharp. This would allow you to log method calls without cluttering your code. Behind the scenes you'd still be using the excellent log4net.

    Caveat: I haven't used it myself; I've seen a very impressive presentation on it at a code camp.

提交回复
热议问题