Log strategies
A common problem when dealing with logs is deciding on the appropriate severity for each of the individual services. Is this message a WARNING
or an ERROR
? Should this statement be added as an INFO
message or not?
Most of the log severity descriptions have definitions, such as the program shows a potentially harmful situation or the application highlights the progress of the request. These are vague definitions and difficult to act on in a real-life situation. Instead of using these vague definitions, try to define each level in relationship with any follow-up action that should be taken if the issue is encoutered. This helps to clarify to the developers what to do when a given error log is found. For example: "Do I want to be informed each and every time this situation happens?"
The following table shows some examples of the different severity levels and what action could be taken: