When logging when is an error fatal?

后端 未结 4 835
既然无缘
既然无缘 2021-02-01 02:29

In logging frameworks like log4j & log4net you have the ability to log various levels of information. Most of the levels have obvious intentions (such as what a \"Debug\" lo

4条回答
  •  逝去的感伤
    2021-02-01 03:28

    To make this answer short and sweet, if your application crashes, I would consider that fatal. If you cannot connect to an important resource such as a database or a required service, that would be fatal. Overall, I would say that if it keeps your application from running correctly and affects the user, I would classify it as a fatal error.

    But the most important way to classify errors is to consistently follow a rule of thumb such as rule 69 in C++ Coding Standards:

    "Develop a practical, consistent, and rational error handling policy early in design, and then stick to it."

提交回复
热议问题