Log4j defines the Log Level and log4j Log Level of a class.

Source: Internet
Author: User

Log4j defines the Log Level and log4j Log Level of a class.

After a scheduled task is introduced into the project, when I delete an existing scheduled task

 

[Org. springframework. scheduling. quartz. localperformancejobstore] ClusterManager: detected 1 failed or restarted instances.
[Org. springframework. scheduling. quartz. localperformancejobstore] ClusterManager: Scanning for instance "***"'s failed in-progress jobs.

Such logs are refresh every second, and are flushed on the console.

After I failed to find a solution, I thought of using log4j to shield this log.

The code for blocking is as follows:

Log4j. rootLogger = INFO, A1, Rlog4j.logger.org. springframework. scheduling. quartz. localperformancejobstore = warn

The console generates INFO-level logs, so you can set the Z log level to warn level.

Log4j in the code. logger. **, the following ** is the class at the level you want to define. If you are not sure about the class, you can refer to the content in [] before the log generation, that is, the log generation class.

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.