The logger (Logger) is the core component of log processing.
There are 7 levels of log4j.
Available levels of the logger (Logger) level (excluding custom level levels)
Priority from high to Low:
OFF, FATAL,
ERROR, WARN, INFO, DEBUG,
TRACE, all
OFF
The off level is the highest grade and is used to turn off all log records.
FATAL
FATAL level indicates that each serious error event will cause the application to exit.
ERROR
The error level indicates that the system continues to operate without affecting the failure event.
WARN
WARN level indicates a potential error situation.
INFO
The INFO level indicates that the message highlights the application's running process at a coarse-grained scale.
DEBUG
The debug level indicates that fine-grained information events are very helpful for debugging applications.
TRACE
Thetracelevel designates finer-grained informational events than the DEBUG. since:1.2.12
All
All levels are the lowest level and are used to open all log records.
LOG4J recommends using only four levels, with the priority from high to low being error, WARN, INFO, DEBUG.
By defining the level here, you can control the switch to the appropriate level of log information in your application.
For example, if the info level is defined here, the log information for all debug levels in the application will not be printed.
The program prints logs that are above or equal to the level you set, and the higher the log level, the less logs are printed.
If the setting level is info, the log information with priority higher than or equal to the info level (such as: info, WARN, ERROR) will be output and less than that level of debug will not be output.
Log4j Log Level