Skip to content

Root log4j logger levels are not restored during initialization #2125

@membersound

Description

@membersound

Up to 1.1.9.RELEASE spring-boot was able to find log4j2.xml itself from src/main/resources. It was picked up and loaded correctly by just dropping the required maven dependencies in.

Since 1.2.0.RELEASE this is not the case anymore. I have to explicit set

logging.config=classpath:log4j2.xml

to load it.

Of course I configured the maven pom as advised:

          <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
        </dependency>

Root cause is probably in AbstractLoggingSystem.initialize(), which has been massively refactored between 1.1.9 and 1.2.0.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions