linux log level

Taking log4j log level as an example,
log4j provides 4 log levels and 2 log switches.
Official URL: http://logging.apache.org/log4j/1.2/

DEBUG: Output debug information; indicates that fine-grained information events are very helpful for debugging applications.
INFO: Output prompt information; messages highlight the running process of the application at a coarse-grained level.
WARN: Output a warning message; indicates a potential error situation.
ERROR: Output error information; indicate that although an error event occurs, it still does not affect the continued operation of the system.
FATAL: Output fatal errors; indicates that each serious error event will cause the application to exit.
ALL level: Turns on all logging switches; is the lowest level and turns on all logging.
OFF level: Turns off all logging switches; is the highest level and turns off all logging.

Sort according to the range from large to small: ALL level > DEBUG > INFO > WARN > ERROR > FATAL > OFF level; a large range will include a small range, for example, if the log is set to INFO level, the logs of FATAL, ERROR, WARN, INFO The switches are all on, while DEBUG's log switch will be off.

Log4j recommends using only four levels, the priority from high to low is ERROR, WARN, INFO, DEBUG.

Guess you like

Origin blog.csdn.net/qq_17576885/article/details/123227511