Log4j Log Level

Source: Internet
Author: User

Transferred from: http://michales003.iteye.com/blog/1160605

The logger (Logger) is the core component of log processing. The log4j has 5 levels of normal (level). :
1.static level DEBUG:
The debug level indicates that fine-grained information events are very helpful for debugging applications.
2.static level INFO
The INFO level indicates that the message highlights the application's running process at a coarse-grained scale.
3.static level WARN
WARN level indicates a potential error situation.
4.static level ERROR
The error level indicates that the system continues to operate without affecting the failure event.
5.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:
1.static All
All levels are the lowest level and are used to open all log records.
2.static level OFF
The off level is the highest grade and is used to turn off all log records.

The behavior of the logger (Logger) is graded:
Divided into off, FATAL, ERROR, WARN, INFO, DEBUG, all, or the level you define. LOG4J recommends using only four levels, with the priority from high to low being ERROR, WARN, INFO, DEBUG. By defining the level here, you can control the switch to the appropriate level of log information in your application. For example, if the info level is defined here, the log information for all debug levels in the application will not be printed.

High priority will be printed out. In the production environment of the project, you must re-tune the debug log level to warn or higher to avoid generating a large number of logs.

Log4j Log Level

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.