Is Log4j2 xml configuration case sensitive?

3.5k views Asked by At

Lets assume that I have Log4j2 xml configuration similar to

<?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>

Mostly I am interested in two parameters here - level and size. So, is there any difference if I write INFO instead of info or 10mb instead of 10MB? What about other parameters?

1

There are 1 answers

0
Rufi On BEST ANSWER

This is a relative part from the 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.