Convert <log4j:configuration> (in log4j 1.x) to <Configuration> (in log4j 2.x)

huangapple go评论67阅读模式
英文:

Convert <log4j:configuration> (in log4j 1.x) to <Configuration> (in log4j 2.x)

问题

我需要将log4j 1.x的XML配置迁移到log4j 2.x配置XML。我找不到一些log4j1配置属性的log4j2等效配置。我在log4j1 XML中有以下行:

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" threshold="trace" reset="true" debug="false">

我想要一个等效的log4j2配置,类似于:

<Configuration>

我知道status=&quot;debug&quot;会启用log4j2内部的详尽日志记录。但默认情况下它是关闭的,正如我所需要的那样。有人能建议log4j2 XML中threshold=&quot;trace&quot;reset=&quot;true&quot;的等效配置吗?

英文:

I need to migrate log4j 1.x XML configuration to log4j 2.x configuration XML. I couldn't find log4j2 equivalent configurations to some of the log4j1 configuration attributes. I have following line in log4j1 XML:

&lt;log4j:configuration xmlns:log4j=&quot;http://jakarta.apache.org/log4j/&quot; threshold=&quot;trace&quot; reset=&quot;true&quot; debug=&quot;false&quot;&gt;

I want to have an equivalent log4j2 configuration, something like:

&lt;Configuration&gt;

I know status=&quot;debug&quot; would enable extensive logging of log4j2 internals. But by default it is turned off as I need. Could anyone suggest the equivalent configurations for threshold=&quot;trace&quot; and reset=&quot;true&quot; in log4j2 XML?

答案1

得分: 1

Log4j2不支持这两个属性。

英文:

Log4j2 does not support either of those attributes.

huangapple
  • 本文由 发表于 2020年1月3日 19:01:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/59577396.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定