“log4j:configuration”必须匹配“(渲染器... .loggerFactory)?)”

编程入门 行业动态 更新时间:2024-10-24 08:21:18
本文介绍了“log4j:configuration”必须匹配“(渲染器... .loggerFactory)?)”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在将war文件部署到tomcat时出错:

getting error, when deploying my war file to tomcat:

log4j:WARN The content of element type "log4j:configuration" must match "(renderer*,throwableRenderer?,appender*,plugin*,(category|logger)*,root?,(categoryFactory|loggerFactory)?)"

我google了一下,发现我的log4j.xml的排序可能是错误的,但它应该是正确的。

I googled around and found out that ordering of my log4j.xml could be wrong, but it should be correct.

<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="jakarta.apache/log4j/"> <appender name="console" class="org.apache.log4j.ConsoleAppender"> <param name="Target" value="System.out"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-5p %d %c %x - %m%n"/> </layout> </appender> <root> <priority value ="error" /> <appender-ref ref="console" /> </root> <category name="org.springframework" additivity="false"> <priority value="info" /> <appender-ref ref="console" /> </category> </log4j:configuration>

有什么建议吗?

推荐答案

根据错误消息,DTD希望所有 category 元素都位于 root 元素。你有错误的方法。

According to the error message, the DTD expects all category elements to be ahead of the root element. You have them the wrong way round.

更多推荐

“log4j:configuration”必须匹配“(渲染器... .loggerFactory)?)”

本文发布于:2023-11-14 10:17:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586950.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:渲染器   log4j   configuration   loggerFactory

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!