Skip to content

Regression: Commons Logging setup in AnnotationUtils causes early initialization of logging system [SPR-12329] #16934

Closed
@spring-projects-issues

Description

@spring-projects-issues

Yanming Zhou opened SPR-12329 and commented

I am using log4j, and using a custom system property "app.home" placeholder in log4j configuration.

<param name="file" value="${app.home}/logs/application.log"/>

set system property with a ServletContextListener.contextInitialized(), It works fine util I have more than one WebApplicationInitializers, after my investigation, I found it caused by SpringServletContainerInitializer

AnnotationAwareOrderComparator.sort(initializers);

AnnotationAwareOrderComparator depends on org.springframework.core.annotation.AnnotationUtils, AnnotationUtils used commons-logging, It will make my log4j premature, "app.home" will eval as empty since SpringServletContainerInitializer is executed before any ServletContextListener.contextInitialized().

please remove logging from AnnotationUtils, it's not useful. or use java.util.logging instead.


Affects: 4.0.7, 4.1.1

Issue Links:

Backported to: 4.0.8

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions