Log4j

Log4j is the project run by The Apache Software Foundation. This project helps in enabling the logs at the various levels of the server and application.

The major advantage of log4j is manageability. It provides the developer a freedom to change the log level at the configuration file level. Also, you can enable/disable logs at the configuration level, so there is no need to change the code. We can customize the log pattern based on the application, separately. Log4j has six log levels. The following figure shows the different types of log levels in log4j:

Log4j

Log level for log4j

Every log level in log4j has its own functionality. The following ...

Get Apache Tomcat 7 Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.