https://issues.apache.org/bugzilla/show_bug.cgi?id=44644
Summary: Default ContentType for Layout is text/html which is
FALSE
Product: Log4j
Version: 1.2
Platform: All
OS/Version: All
Status: NEW
Keywords: PatchAvailable, RFC
Severity: normal
Priority: P2
Component: Layout
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
Default ContentType (Layout.getContentType() method) is "text/plain", inherited
by SimpleLayout.
Default ContentType for HTMLLayout is "text/html".
This is FALSE, because it is not. These layouts' messages are backed by java
strings, and java strings are mandatorily unicode. Thus, the correct
ContentType for layouts is `text/plain; charset="UTF-8"' and `text/html;
charset="UTF-8"' respectively.
This becomes more and more important as various java libs internationalize
their error messages. XALAN xslt processor does that, and Postgres database
does that also. Trying to log these errors via SMTPAppender yields a crop of
question-marks, which is not really useful since you probably wanted these to
bring answers rather than questions.
If this can cause errors due to applications expecting no charset= field there,
you can fix just SMTPAppender which really trashes its mails.
For now, I've just did
new SimpleLayout() {
@Override
public String getContentType()
{
return "text/plain; charset=\"UTF-8\"";
}
}
But I think this bug should be addressed at your level.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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]