Hibernate Logging using Log4j

This section contains detail description of how you can use Log4j for logging
configuration.

During development or after release, sometimes some unexpected error occurred
with the application. To trace the error, logging is very helpful. Log4j is the
tool which helps in displaying logs or keeping it's track(for example in a log
file). Using Log4j logging can be enable at run time without modifying
the application code.

In the below application, we included log4j-1.2.14.jar in the
lib directory to implement logging using Log4j. Log4j is
reliable, faster and extensible. It is easy to understand and easy to implement.

Log4j has three main components :

Loggers
Loggers is used to log messages.

Appenders Appenders is used to determine the
output destination like console or a file.