You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/01/04 15:27:08 UTC

[tomcat] branch master updated: Fix BZ 65047 include user info if access log valve can't open log file

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new 22caea3  Fix BZ 65047 include user info if access log valve can't open log file
22caea3 is described below

commit 22caea3a8a77bb894c0effffc249c7d2c594e59d
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jan 4 15:26:51 2021 +0000

    Fix BZ 65047 include user info if access log valve can't open log file
    
    https://bz.apache.org/bugzilla/show_bug.cgi?id=65047
---
 java/org/apache/catalina/valves/AccessLogValve.java     | 2 +-
 java/org/apache/catalina/valves/LocalStrings.properties | 2 +-
 webapps/docs/changelog.xml                              | 5 +++++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/valves/AccessLogValve.java b/java/org/apache/catalina/valves/AccessLogValve.java
index b133e10..5aa090b 100644
--- a/java/org/apache/catalina/valves/AccessLogValve.java
+++ b/java/org/apache/catalina/valves/AccessLogValve.java
@@ -656,7 +656,7 @@ public class AccessLogValve extends AbstractAccessLogValve {
         } catch (IOException e) {
             writer = null;
             currentLogFile = null;
-            log.error(sm.getString("accessLogValve.openFail", pathname), e);
+            log.error(sm.getString("accessLogValve.openFail", pathname, System.getProperty("user.name")), e);
         }
         // Rotating a log file will always trigger a new file to be opened so
         // when a new file is opened, check to see if any old files need to be
diff --git a/java/org/apache/catalina/valves/LocalStrings.properties b/java/org/apache/catalina/valves/LocalStrings.properties
index fe373fd..2f3a68e 100644
--- a/java/org/apache/catalina/valves/LocalStrings.properties
+++ b/java/org/apache/catalina/valves/LocalStrings.properties
@@ -20,7 +20,7 @@ accessLogValve.invalidLocale=Failed to set locale to [{0}]
 accessLogValve.invalidPortType=Invalid port type [{0}], using server (local) port
 accessLogValve.invalidRemoteAddressType=Invalid remote address type [{0}], using remote (non-peer) address
 accessLogValve.openDirFail=Failed to create directory [{0}] for access logs
-accessLogValve.openFail=Failed to open access log file [{0}]
+accessLogValve.openFail=Failed to open access log file [{0}] Note: running as user [{1}]
 accessLogValve.renameFail=Failed to rename access log from [{0}] to [{1}]
 accessLogValve.rotateFail=Failed to rotate access log
 accessLogValve.unsupportedEncoding=Failed to set encoding to [{0}], will use the system default character set.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2373340..5a9f377 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -146,6 +146,11 @@
         <bug>65033</bug>: Fix JNDI realm error handling when connecting to a
         failed server when pooling was not enabled. (remm)
       </fix>
+      <fix>
+        <bug>65047</bug>: If the <code>AccessLogValve</code> is unable to open
+        the access log file, include information on the current user in the
+        associated log message  (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org