Repository: logging-log4j2 Updated Branches: refs/heads/master b1a09ce32 -> ebc53bbdc
LOG4J2-1262 - Stop throwing unnecessary exception in Log4jServletContextListener.contextDestroyed(). Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/ebc53bbd Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/ebc53bbd Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/ebc53bbd Branch: refs/heads/master Commit: ebc53bbdce108bb6b5af86595a11eddca256a353 Parents: b1a09ce Author: Matt Sicker <[email protected]> Authored: Wed Mar 2 20:21:19 2016 -0600 Committer: Matt Sicker <[email protected]> Committed: Wed Mar 2 20:21:42 2016 -0600 ---------------------------------------------------------------------- .../org/apache/logging/log4j/web/Log4jServletContextListener.java | 3 ++- src/changes/changes.xml | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebc53bbd/log4j-web/src/main/java/org/apache/logging/log4j/web/Log4jServletContextListener.java ---------------------------------------------------------------------- diff --git a/log4j-web/src/main/java/org/apache/logging/log4j/web/Log4jServletContextListener.java b/log4j-web/src/main/java/org/apache/logging/log4j/web/Log4jServletContextListener.java index 35f4aae..f4afaba 100644 --- a/log4j-web/src/main/java/org/apache/logging/log4j/web/Log4jServletContextListener.java +++ b/log4j-web/src/main/java/org/apache/logging/log4j/web/Log4jServletContextListener.java @@ -52,7 +52,8 @@ public class Log4jServletContextListener implements ServletContextListener { @Override public void contextDestroyed(final ServletContextEvent event) { if (this.servletContext == null || this.initializer == null) { - throw new IllegalStateException("Context destroyed before it was initialized."); + LOGGER.warn("Context destroyed before it was initialized."); + return; } LOGGER.debug("Log4jServletContextListener ensuring that Log4j shuts down properly."); http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ebc53bbd/src/changes/changes.xml ---------------------------------------------------------------------- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index eaf24b5..30f7a67 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -178,6 +178,9 @@ <action issue="LOG4J2-1275" dev="mattsicker" type="fix" due-to="Ludovic Hochet"> Fix RollingAppenderNoUnconditionalDeleteTest repeat test runs from failing. </action> + <action issue="LOG4J2-1262" dev="mattsicker" type="fix"> + Stop throwing unnecessary exception in Log4jServletContextListener.contextDestroyed(). + </action> </release> <release version="2.5" date="2015-12-06" description="GA Release 2.5"> <action issue="LOG4J2-324" dev="rpopma" type="fix">
