nlog

Logger wrapper best practice

泪湿孤枕 提交于 2019-11-26 01:37:04
问题 I want to use a nlogger in my application, maybe in the future I will need to change the logging system. So I want to use a logging facade. Do you know any recommendations for existing examples how to write those ones ? Or just give me link to some best practice in this area. 回答1: I used to use logging facades such as Common.Logging (even to hide my own CuttingEdge.Logging library), but nowadays I use the Dependency Injection pattern and this allows me to hide loggers behind my own (simple)

Most useful NLog configurations [closed]

五迷三道 提交于 2019-11-25 20:00:52
What are the best or most useful configurations for logging with NLog? (These can be simple or complex, as long as they're useful.) I'm thinking of examples like automatically rolling over log files at a certain size, changing the layout (log message) whether or not there is an exception, escalating the log level once an error has occurred, etc. Here are some links: NLog Demo Examples in the source wageoghe Some of these fall into the category of general NLog (or logging) tips rather than strictly configuration suggestions. Here are some general logging links from here at SO (you might have