Logger

Log4j has three main components:

loggers, appendersand layouts. These three types of components work together to enable developers to log messages according to message type and level, and to control at runtime how these messages are formatted and where they are reported.

The first and foremost advantage of any logging API over plain System.out.printlnresides in its ability to disable certain log statementswhile allowing others to print unhindered

Loggers maybe assigned levels. The set of possible levels, that is:

TRACE,
DEBUG,
INFO,
WARN,
ERRORand
FATAL