Log4j Log Level

Source: Internet
Author: User

The log recorder (Logger) is the core component of log processing. LOG4J has 5 levels of normal (level). Available level levels (excluding custom level levels) for the logger (Logger), the following is an excerpt from the log4j API (http://jakarta.apache.org/log4j/docs/api/index.html):

Static level DEBUG

The debug level indicates that fine-grained informational events are useful for debugging applications.

Static level INFO

The INFO level indicates that the message highlights the application's running process at the coarse-grained levels.

Static level WARN

The WARN level indicates a scenario where a potential error occurs.

Static level ERROR

The error level indicates that, while an incorrect event occurs, it does not affect the continued operation of the system.

Static level FATAL

FATAL level indicates that each serious error event will cause the application to exit.

In addition, there are two special logging levels available: (The following description comes from the log4j API http://jakarta.apache.org/log4j/docs/api/index.html):

Static level All

All levels are the lowest level and are used to open all log records.

Static level off

Off levels are the highest level and are used to turn off all log records.

The behavior of the log recorder (Logger) is hierarchical. As shown in the following table:

is divided into off, FATAL, ERROR, WARN, INFO, DEBUG, all, or levels you define. LOG4J recommends using only four levels, from high to low, respectively, for error, WARN, INFO, and DEBUG. By the level defined here, you can control the switch to log information at the appropriate level in your application. For example, if the info level is defined here, all debug-level log information in the application will not be printed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.