Log4j Levels

In log4j, the set of possible levels are as follows:

Level Description
DEBUG The DEBUG Level designates fine-grained informational events that are most useful to debug an application.
TRACE The TRACE Level designates finer-grained informational events than the DEBUG.
INFO The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
WARN The WARN level designates potentially harmful situations.
ERROR The ERROR level designates error events that might still allow the application to continue running.
FATAL The FATAL level designates very severe error events that will presumably lead the application to abort.


In addition, there are two special levels of logging available that are as follows:

Level Description
ALL The ALL Level has the lowest possible rank and is intended to turn on all logging.
OFF The OFF Level has the highest possible rank and is intended to turn off logging.


When a logger is created, generally you assign a level. The logger outputs all those messages equal to that level and also all greater levels than it.

Table 1.1 Logger Output Hierarchy
Level TRACE DEBUG INFO WARN ERROR FATAL
TRACE Yes Yes Yes Yes Yes Yes
DEBUG No Yes Yes Yes Yes Yes
INFO No No Yes Yes Yes Yes
WARN No No No Yes Yes Yes
ERROR No No No No Yes Yes
FATAL No No No No No Yes
ALL Yes Yes Yes Yes Yes Yes
NO No No No No No No




,

No comments yet.

Leave a Reply