Log4net/Logging - What have you found to be useful?

后端 未结 8 1397
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-30 07:41

I just started using Log4Net and was looking to see what you have found to be useful in your logging experiences.

What types of things have you found to be useful to log

8条回答
  •  心在旅途
    2021-01-30 07:48

    • All exceptions get logged at ERROR level at the highest level in the call stack that is possible (typically in event handlers etc)
    • User input that causes a problem gets logged at WARN level (because it might indicate that we need to improve our UI to better guide the user)
    • "Significant" activities get logged at INFO level (i.e. anything that involves billing a customer's credit card, queries to a third party API etc), including the data involved (typically XML serialized, with any sensitive information removed)
    • Very verbose activities might be logged at DEBUG level

    We seldom use FATAL level logging.

    We normally deploy with a RollingLogFileAppender at INFO level, and an SmtpAppender at ERROR level.

提交回复
热议问题