Log4j Log Level Conversion

Source: Internet
Author: User

 

Logger is the core component of log processing. Log4j has five levels ). The available level of the logger (excluding the Custom Level), which is taken from the log4j API (http://jakarta.apache.org/log4j/docs/api/index.html ):

Static level debug

Debug level indicates that fine-grained information events apply to debugging applicationsProgramIt is very helpful.

Static level info

Info level indicates that messages emphasize the running process of applications at the coarse granularity level.

Static level warn

Warn level indicates a potential error.

Static Level Error

Error level indicates that although an error event occurs, the operation of the system is not affected.

Static level fatal

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

There are also two available special logging levels (from the log4j API http://jakarta.apache.org/log4j/docs/api/index.html below ):

Static level all

The all level is the lowest level and is used to open all log records.

Static level off

The off level is the highest level and is used to close all log records.

Logger behaviors are classified. See the following table:

It is divided into off, fatal, error, warn, info, debug, all, or the level you define. We recommend that you use only four levels of log4j. The priority ranges from high to low: error, warn, info, and debug. By defining the level here, you can control the switch to the corresponding level of log information in the application. For example, if the info level is defined here, all debug-level logs 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.