Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chainsaw gateway generates malformed XML #141

Open
GoogleCodeExporter opened this issue Mar 13, 2016 · 0 comments
Open

Chainsaw gateway generates malformed XML #141

GoogleCodeExporter opened this issue Mar 13, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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    (re
vision 1908)
+++ 
src/main/actionscript/org/as3commons/logging/setup/target/ChainsawGateway.as    (wo
rking 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>');
        }


Original issue reported on code.google.com by [email protected] on 31 May 2013 at 12:36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant