member sound created LOG4J2-3422:
------------------------------------

             Summary: Prevent setting Log4j2CloudConfigLoggingSystem as 
tomcat-wide system property using log4j-spring-boot
                 Key: LOG4J2-3422
                 URL: https://issues.apache.org/jira/browse/LOG4J2-3422
             Project: Log4j 2
          Issue Type: Improvement
    Affects Versions: 2.17.1
         Environment: spring-boot-2.6.4, log4j2-2.17.1
            Reporter: member sound


Follow-Up issue from discussion in 
https://github.com/spring-projects/spring-boot/issues/30017

Setting: Tomcat 9 Standalone Server with *multiple* independent spring-boot 
applications.

Problem: as soon as one of those applications adds {{log4j-spring-boot}} 
dependency, then *all* applications running on the same tomcat are forced to 
add this dependency.

This seems to be because:
{code}
org.springframework.boot.logging.LoggingSystem=org.apache.logging.log4j.spring.boot.Log4j2CloudConfigLoggingSystem
{code}

https://github.com/apache/logging-log4j2/blob/f72100df0decc9bda96b4d769822c4e48b2848fc/log4j-spring-boot/src/main/resources/log4j2.system.properties#L17

https://github.com/apache/logging-log4j2/blob/release-2.x/log4j-spring-boot/src/main/java/org/apache/logging/log4j/spring/boot/Log4j2CloudConfigLoggingSystem.java

This is even worse of other applications would normally rely on the 
spring-default logback logging framework. They are then forced to switch to 
Log4j2.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to