Monday 6 November 2006 @ 4:37 pm
I build two little classes to support logging from Flex/AS3 to SOS.
The logger implements the mx.logging.ILogger interface but not the rest of the mx.logging framework as I liked to keep things in the first way.
Check the example here (right click for source). If you want to test logging directly from a website you have to start a local webserver and put a crossdomain.xml in the root. For further details read here.
Check the source directly here.
“Flex/AS3 Logging with SOS” is open source and licensed under LGPL.








Hi Sönke Rohde,
I tried your classes and I get a few errors …
SOSLogger Line 70 & Line 90 : Syntax Error : bitwiseand is unexpected
SOSLogger Line 90 : Syntax Error : expecting rightbrace before xmltagendend
SOSLogger Line 90 : Syntax Error : expecting rightparen before semicolon
How can I resolve this?
thx, Lieven Cardoen, IndieGroup, Belguim
Hi,
do you get the errors when compiling with mtasc?
Thanks for this. It works great for me. Much better than the default method of tracing to a text file.
One problem I’ve encountered is that if SOS isn’t running and my code tries to log, it throws an exception that looks like this.
at com.soenkerohde.logging::SOSLogger$cinit()
at global$init()
at com.soenkerohde.logging::LogFactory$/getLogger()….
Putting a try/catch around the log statement didn’t help.
I have also seen this problem but no solution yet.
When you got it please tell me
To catch this error you need to add a listener for the thrown IOErrorEvent:
public function SOSLogger( _category:Object ) {
this._category = _category;
socket = new XMLSocket();
socket.addEventListener(IOErrorEvent.IO_ERROR, communicationError);
}
private function communicationError(e:IOErrorEvent):void {
trace(e);
}
Klaus