Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an industry Standard logging levels? [closed]

Tags:

logging

I'm writing a policy document for developers about logging on a particular system.

In my draft doc I have "All logging should be at a sensible level..." which has quite rightly been picked up at review. I mean what is a sensible level?

Is there any generalized, but authoritative guidance out there?

like image 542
Col Wilson Avatar asked Jul 24 '12 10:07

Col Wilson


People also ask

What should be logging level in production?

The usual advice. Logging levels are usually considered to be in order of importance: turn on "unimportant" levels in development ( trace , debug and the like), but enable only the "most important" levels ( warning , error , etc.) in production, where resources like CPU time and disk space are precious.


1 Answers

To reduce the answer to the question of how to choose the right level:

Debug: Messages in this level contain extensive contextual information. They are mostly used for problem diagnosis. Information on this Level are for Developers and not for the Users.

Info: These messages contain some contextual information to help trace execution (at a coarse-grained level) in a production environment.

Warning: A warning message indicates a potential problem in the system. the System is able to handle the problem by themself or to proccede with this problem anyway.

Error: An error message indicates a serious problem in the system. The problem is usually non-recoverable and requires manual intervention.

Both the standard Java Logging API and Apache Log4J provide logging levels beyond these basics. The primary purpose of a logging level is to help you filter useful information out of the noise. To avoid using the wrong level and thus reducing the usefulness of log messages, developers must be given clear guidelines before they start coding.

created on the base of IBM

like image 136
Simulant Avatar answered Sep 27 '22 17:09

Simulant