Commons Logging priority best practices

前端 未结 6 957
一个人的身影
一个人的身影 2021-02-05 15:59

This may be a purely subjective question (if no organization has attempted to standardize this), but my team struggles with this more than you would think.

We use Apache

6条回答
  •  情话喂你
    2021-02-05 16:28

    I'm using a simpler approach:

    • DEBUG: Turned off in production, thus mainly used by the developer to log certain queries, timings, parameter values, etc.

    • INFO: Log everything so that you know in retrospect everything to explain how your results were computed and so that you can fix bugs

    • ERROR: Everything that needs someones (developer/operations) attention

    I don't use WARN, because no-one ever filters all log files for WARN messages. If it is important, then it is ERROR (and someone has to care about it), if not, it is INFO (and no-one is interested in it until there is a problem). Same for FATAL.

    I also don't use TRACE. Everything I need to know during development is DEBUG.

提交回复
热议问题