https://bz.apache.org/bugzilla/show_bug.cgi?id=62788
Bug ID: 62788
Summary: Add explicit ".encoding=UTF-8" to FileHandler
configurations in logging.properties
Product: Tomcat 9
Version: 9.0.12
Hardware: PC
Status: NEW
Severity: enhancement
Priority: P2
Component: Catalina
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: -----
This is inspired by a StackOverflow question [1].
While most of Tomcat 8.5/9.0 uses UTF-8 by default, the default configuration
of (Async)FileHandlers in logging.properties is to use the system default
character set.
1. There is no configuration for the "encoding" property of those FileHandlers
in the default 'logging.properties' file.
2. The default value for that property is to use the system default character
set. As documented in javadoc [2].
I find this odd.
My proposal is to add explicit configuration for the 'encoding' property of
AsyncFileHandlers in Tomcat 9.0.x onwards to be 'UTF-8':
1catalina.org.apache.juli.AsyncFileHandler.encoding = UTF-8
etc.
I think that for a ConsoleHandler [3] it is expected to use the system
encoding. It is used for monitoring at development time, and should not be used
on a production system.
I think that a file written by a FileHandler is expected to preserve all
information written to it, and UTF-8 suits better for this purpose.
[1]
https://stackoverflow.com/questions/52591511/how-to-set-character-encoding-to-servletcontext-logs-in-tomcat
[2]
http://tomcat.apache.org/tomcat-9.0-doc/api/org/apache/juli/FileHandler.html
[3]
https://docs.oracle.com/javase/6/docs/api/java/util/logging/ConsoleHandler.html
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]