Log4j Use properties file configuration, can not apply the filter solution

Source: Internet
Author: User

The log4j version I use is 1.2.16, a filter to filter the log information for an interval level when customizing Appender. However, there are still errors in the properties file configuration for a long time

Log4j:warn Failed to set the [filter] to value "Org.apache.log4j.varia.LevelRangeFilter".
Log4j:error could not instantiate class [FATAL].

Then I found the answer in a foreign forum.

The propertyconfigurator does not handle the advanced configuration features supported by the Domconfigurator such as Supp ORT for Filters, custom errorhandlers, nested appenders such as the Asyncappender, etc.

Translated as follows:

Propertyconfigurator cannot handle advanced configuration features supported by Domconfigurator, such as filter support, custom error handlers, nested Appender (such as asyncappender), etc.

It seems that XML configuration is the king of log4j. Sure enough, the XML configuration can be used.

Reference Address: http://stackoverflow.com/questions/1257641/cant-set-levelrangefilter-for-log4j

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.