• Andy Wilkinson's avatar
    Disable Log4j2's shutdown hook by default · cf940fd3
    Andy Wilkinson authored
    Previously, Log4j2's own shutdown hook was only disabled when Log4j2
    detected javax.servlet.Servlet on the classpath and, therefore,
    determined that it was running in a web application. In an application
    without Servlet on the classpath, this could lead to both Log4j2's shut
    down hook and and logging system's shutdown handler both stopping
    Log4j2. This could result in a failure as the second attempt at stopping
    would result in reinitialization which would fail as the JVM is already
    shutting down.
    
    This commit introduces a new Log4j2 PropertySource implementation,
    registered via META-INF/services, that sets the
    log4j.shutdownHookEnabled property to false. This will ensure that
    Log4j2's own shutdown hook is disabled by default whenever Spring Boot
    is on the classpath and not just in Servlet-based web applications.
    
    Fixes gh-26953
    cf940fd3
Name
Last commit
Last update
.github Loading commit data...
buildSrc Loading commit data...
ci Loading commit data...
eclipse Loading commit data...
git/hooks Loading commit data...
gradle/wrapper Loading commit data...
idea Loading commit data...
spring-boot-project Loading commit data...
spring-boot-tests Loading commit data...
src Loading commit data...
.editorconfig Loading commit data...
.gitignore Loading commit data...
CODE_OF_CONDUCT.adoc Loading commit data...
CONTRIBUTING.adoc Loading commit data...
LICENSE.txt Loading commit data...
README.adoc Loading commit data...
SUPPORT.adoc Loading commit data...
build.gradle Loading commit data...
gradle.properties Loading commit data...
gradlew Loading commit data...
gradlew.bat Loading commit data...
settings.gradle Loading commit data...