Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 141 by
samuelso...@gmail.com: Chainsaw gateway generates
malformed XML
http://code.google.com/p/as3-commons/issues/detail?id=141
What steps will reproduce the problem?
1.Create a logger using ChainsawTarget
2.Run application
3.
What is the expected output? What do you see instead?
Expect a logger to be created by chainsaw.
XML parsing errors reported by chainsaw.
What version of the product are you using? On what operating system?
1.7
Please provide any additional information below.
The problems is that the write statement in ChainsawGateway fails to
properly terminate the CDATA element that it starts.
The following patch fixes the problem for me.
Index:
src/main/actionscript/org/as3commons/logging/setup/target/ChainsawGateway.as
===================================================================
---
src/main/actionscript/org/as3commons/logging/setup/target/ChainsawGateway.as
(revision 1908)
+++
src/main/actionscript/org/as3commons/logging/setup/target/ChainsawGateway.as
(working copy)
@@ -66,7 +66,7 @@
*/
public function log(name:String, time:Number, level:int,
message:String): void {
doLog('<log4j:event logger="'+name+'" timestamp="'+(START_TIME+time)+'"
level="'+LEVEL_NAMES[level]+'" thread="'+_applicationThread+'"
xmlns:log4j="
http://jakarta.apache.org/log4j/">'
-
+ '<log4j:message><![CDATA['+message.replace(/\<\!\[CDATA\[/gi, "").replace(/\]\]\>/gi, "")+'</log4j:message>'
+
+ '<log4j:message><![CDATA['+message.replace(/\<\!\[CDATA\[/gi, "").replace(/\]\]\>/gi, "")+']]></log4j:message>'
+ '<log4j:properties><log4j:data name="application"
value="'+_applicationName+'" /></log4j:properties>'
+ '</log4j:event>');
}
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings