You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by li...@apache.org on 2022/12/20 05:34:40 UTC

[tomcat] branch 9.0.x updated: Fix BZ 66392 - Change the default value of AccessLogValve's file encoding to UTF-8.

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

lihan pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 5ffa858953 Fix BZ 66392 - Change the default value of AccessLogValve's file encoding to UTF-8.
5ffa858953 is described below

commit 5ffa8589537dd80ba5304e38646332bb76932c68
Author: lihan <li...@apache.org>
AuthorDate: Tue Dec 20 13:33:48 2022 +0800

    Fix BZ 66392 - Change the default value of AccessLogValve's file encoding to UTF-8.
    
    https://bz.apache.org/bugzilla/show_bug.cgi?id=66392
---
 java/org/apache/catalina/valves/AccessLogValve.java | 10 +++++-----
 webapps/docs/changelog.xml                          |  4 ++++
 webapps/docs/config/valve.xml                       |  3 +--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/catalina/valves/AccessLogValve.java b/java/org/apache/catalina/valves/AccessLogValve.java
index 5aa090bd3d..12331ebb28 100644
--- a/java/org/apache/catalina/valves/AccessLogValve.java
+++ b/java/org/apache/catalina/valves/AccessLogValve.java
@@ -150,9 +150,9 @@ public class AccessLogValve extends AbstractAccessLogValve {
     protected String fileDateFormat = ".yyyy-MM-dd";
 
     /**
-     * Character set used by the log file. If it is <code>null</code>, the
-     * system default character set will be used. An empty string will be
-     * treated as <code>null</code> when this property is assigned.
+     * Character set used by the log file. If it is <code>null</code>, UTF-8
+     * will be used. An empty string will be treated as <code>null</code>
+     * when this property is assigned.
      */
     protected volatile String encoding = null;
 
@@ -342,7 +342,7 @@ public class AccessLogValve extends AbstractAccessLogValve {
     /**
      * Return the character set name that is used to write the log file.
      *
-     * @return Character set name, or <code>null</code> if the system default
+     * @return Character set name, or <code>null</code> if the default
      *  character set is used.
      */
     public String getEncoding() {
@@ -644,7 +644,7 @@ public class AccessLogValve extends AbstractAccessLogValve {
             }
         }
         if (charset == null) {
-            charset = StandardCharsets.ISO_8859_1;
+            charset = StandardCharsets.UTF_8;
         }
 
         try {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index fe4271410c..07a669dd99 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -113,6 +113,10 @@
         lookups for resources that contained one or more characters in their
         name that required escaping when used in a URI path. (markt)
       </fix>
+      <fix>
+        <bug>66392</bug>: Change the default value of <code>AccessLogValue</code>'s
+        file encoding to UTF-8 and update documentation. (lihan)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 0f2a9ed792..24d6038751 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -165,8 +165,7 @@
 
       <attribute name="encoding" required="false">
         <p>Character set used to write the log file. An empty string means
-        to use the system default character set. Default value: use the
-        system default character set.
+        to use the default character set. Default value: UTF-8.
         </p>
       </attribute>
 


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