From: markt Date: Mon, 28 Mar 2011 19:19:23 +0000 (+0000) Subject: Protect against things going wrong during access logging. An un-handled exception... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6b29e3a25e39b89581ab9e18a9c9f5d601d5b750;p=tomcat7.0 Protect against things going wrong during access logging. An un-handled exception here could trigger some unexpected code paths. 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 --- diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java b/java/org/apache/catalina/connector/CoyoteAdapter.java index 6a17264c7..de2f7d29f 100644 --- a/java/org/apache/catalina/connector/CoyoteAdapter.java +++ b/java/org/apache/catalina/connector/CoyoteAdapter.java @@ -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(); diff --git a/java/org/apache/catalina/connector/LocalStrings.properties b/java/org/apache/catalina/connector/LocalStrings.properties index 1c48aef95..a0d38fa42 100644 --- a/java/org/apache/catalina/connector/LocalStrings.properties +++ b/java/org/apache/catalina/connector/LocalStrings.properties @@ -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