On Jun 29, 2004, at 3:55 AM, Micha�l CATANZARITI wrote:
Hello,
In order to send events to Chainsaw, you have to use the XMLSocketAppender and not the SocketAppender, since the binary formats are not compatible
I assume the incompatibility was not intentional. Would the project be open to a patch that would make log4cxx binary compatible with log4j's SocketAppender?
[EMAIL PROTECTED] wrote:Hi there, I've tried to use Chainsaw v2 together with the SocketAppender
of Log4Cxx. As far as I've understood the documentation this should
work but it didn't. So I've got several questions on this topic:
1. Am I wrong ? I mean regarding my assumption that Chainsaw v2
should work together with Log4Cxx. I don't know how Java
serialization stores the bytes in a stream but I doubt that the
implementation of the Log4Cxx generates the proper byte
stream.
The stream format for Java serialization is defined at http://java.sun.com/j2se/1.4.2/docs/guide/serialization/spec/ protocol.html
2. My current implementation allows to connect to Chainsaw v2
but Chainsaw always says that the streaming header seems to
be corrupted (Exception !). That's why I doubt that the stream
data of Log4Cxx is correct. Is there anything I'm not aware of ?
3. Is there any alternative way which allows to view my logs
remotely ? I mean I don't want to write such an application
unless it's necessary.
If you could modify the log4cxx SocketHandler to use a stream format compatible with log4j's, you could use Chainsaw without the performance issue that you fear with XML serialization (though it would be good to test if that fear is legitimate). The process that I would use would be to construct some sample log4j LogEvents and serialize them to a local file, then write a serializer for log4cxx that results in identical bytes for the corresponding log4cxx events. Then wire that serializer into SocketAppender.
