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

后端 未结 8 1389
爱一瞬间的悲伤
爱一瞬间的悲伤 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条回答
  •  -上瘾入骨i
    2021-01-30 07:53

    I use four types of log statements:

    • DEBUG
    • INFO
    • WARNING
    • ERROR

    I use DEBUG for statements I want to check during a debugging session. Usually these don't last to the Release Build. This is where I'm checking on a value of a variable or logging the in and out of a method.

    I use INFO for connection strings, configuration and general bits of info that I always want to see in a log.

    WARNING is used rarely for things I am not sure about or potential error conditions or maybe even check on an exception that I know will get handled up the stack.

    I normally only use ERROR in a Catch Block to report on an exception and in an ExceptionHandler that gets called when no other method handled the exception.

提交回复
热议问题