You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/03/04 15:23:13 UTC

[35/50] [abbrv] logging-log4j2 git commit: LOG4J2-1262 - Stop throwing unnecessary exception in Log4jServletContextListener.contextDestroyed().

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/LOG4J2-1278-gc-free-logger
Commit: ebc53bbdce108bb6b5af86595a11eddca256a353
Parents: b1a09ce
Author: Matt Sicker <bo...@gmail.com>
Authored: Wed Mar 2 20:21:19 2016 -0600
Committer: Matt Sicker <bo...@gmail.com>
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">