Log4j.xml exception: "Log4j:configuration" must match "(renderer*,appender*, (category|logger) * ... Problem Analysis and Solution

Source: Internet
Author: User

using log4j.xml for log4j configuration, the following exception is reported in the project:

log4j:error The content of element type "log4j:configuration" must match "(renderer*,Appender *, (category| logger) *,root?,categoryfactory?) ".

Exception Analysis:

Incorrect location of related elements in log4j.xml

configuration file location and resolution:

After comparison, found in the project log4j.xml "<appender></appender>" put "logger></logger>" Behind,

Adjust the "logger></logger>" to the front of all "<appender></appender>" and restart the project to solve the problem.

Network Reference:

log4j.xml warning log4j:warn The content of element type "log4j:configuration" must match "( Renderer*,appen

Refer to url:http://blog. csdn.net/yizhizouxiaqu/article/details/7208693

Cause the file in log4j.xml is in the wrong position, in the following order:

<renderer></renderer>
<renderer></renderer>
<renderer></renderer>
<appender></appender>
<appender></appender>
<appender></appender>
<plugin></plugin>
<plugin></plugin>
<plugin></plugin>
<logger></logger>
<logger></logger>
<logger></logger>
<category></category>
<category></category>
<category></category>
<root></root>
<root></root>
<root></root>
<loggerfactory></loggerfactory>
<loggerfactory></loggerfactory>
<loggerfactory></loggerfactory>
<categoryfactory></categoryfactory>
<categoryfactory></categoryfactory>
<categoryfactory></categoryfactory>

Log4j.xml Exception: "Log4j:configuration" must match "(renderer*,appender*, (category|logger) * ... Problem analysis and resolution

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.