https://issues.apache.org/bugzilla/show_bug.cgi?id=49354
Summary: XMLLayout writes illegal characters to XML file
Product: Log4j
Version: 1.2
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Layout
AssignedTo: [email protected]
ReportedBy: [email protected]
XMLLayout does not appear to escape or scrub the log message to deal with
illegal characters. This can result in invalid XML output by log4j, which in
turn can cause XML parsers downstream to blow up.
A corner case we encountered while using log4j v1.2.15 produced the attached
XML output. The message, which usually has normal text, ended up having some
illegal XML characters in it. Stylus Studio reports the error on line 2, column
119 as follows:
FATAL ERROR: Invalid character (Unicode: 0x15)
This character is indeed illegal in XML, as per:
http://www.xml.com/axml/target.html#sec-cdata-sect
A nice summary can be found here:
http://www.coderanch.com/t/124970/XML/Invalid-Character-inside-CDATA
XMLLayout should ensure that what it write is legal XML, either by escaping
illegal characters, removing them, or replacing them.
--
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]