Protect against things going wrong during access logging. An un-handled exception...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 28 Mar 2011 19:19:23 +0000 (19:19 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 28 Mar 2011 19:19:23 +0000 (19:19 +0000)
Possible contributing factor to https://issues.apache.org/bugzilla/show_bug.cgi?id=50957 ?

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1086352 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/connector/CoyoteAdapter.java
java/org/apache/catalina/connector/LocalStrings.properties

index 6a17264..de2f7d2 100644 (file)
@@ -482,8 +482,13 @@ public class CoyoteAdapter implements Adapter {
                 (connector.getURIEncoding());
         }
         
-        connector.getService().getContainer().logAccess(
-                request, response, time, true);
+        try {
+            connector.getService().getContainer().logAccess(
+                    request, response, time, true);
+        } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
+            log.warn(sm.getString("coyoteAdapter.accesslogFail"), t);
+        }
         
         if (create) {
             request.recycle();
index 1c48aef..a0d38fa 100644 (file)
@@ -36,6 +36,7 @@ coyoteAdapter.service=An exception or error occurred in the container during the
 coyoteAdapter.read=The servlet did not read all available bytes during the processing of the read event
 coyoteAdapter.parsePathParam=Unable to parse the path parameters using encoding [{0}]. The path parameters in the URL will be ignored.
 coyoteAdapter.debug=The variable [{0}] has value [{1}]
+coyoteAdapter.accesslogFail=Exception while attempting to add an entry to the access log
 
 #
 # CoyoteResponse