gpt4 book ai didi

xml - Log4j2 xml 配置是否区分大小写?

转载 作者:行者123 更新时间:2023-12-04 14:22:03 24 4
gpt4 key购买 nike

让我们假设我有类似的 Log4j2 xml 配置

<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Properties>
<Property name="company.log.folder">.</Property>
</Properties>
<Appenders>
<RollingFile name="mainFile" fileName="${sys:company.log.folder}/main.log"
filePattern="archive-logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.zip">
<PatternLayout>
<Pattern>%d [%t] %-5p %c - %m%n</Pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="10MB"/>
</Policies>
</RollingFile>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="mainFile"/>
</Root>
</Loggers>
</Configuration>

大多数情况下,我对这里的两个参数感兴趣 - 级别和大小。那么,如果我写 INFO 而不是 info 或 10mb 而不是 10MB 有什么区别吗?其他参数呢?

最佳答案

这是 log4j2 documentation 的相对部分:

Log4j can be configured using two XML flavors; concise and strict. The concise format makes configuration very easy as the element names match the components they represent however it cannot be validated with an XML schema. For example, the ConsoleAppender is configured by declaring an XML element named Console under its parent appenders element. However, element and attribute names are are not case sensitive. In addition, attributes can either be specified as an XML attribute or as an XML element that has no attributes and has a text value.

关于xml - Log4j2 xml 配置是否区分大小写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30727503/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com