logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Albert Kennis <aken...@star-us.com>
Subject XMLSocketAppender - call to socket->write commented out???
Date Tue, 20 Sep 2005 15:06:46 GMT
Hello list:

I am trying to use log4cxx to send logging events to Chainsaw V2 via the XMLSocketAppender
channel.  Building the 0.9.8 source results in socket connections being made, but not in log
event data being sent.

I have located the source of this problem:  the following 2 lines are commented out in XMLSocketAppender::renderEvent:


//os->write((void *)T2A(output.c_str()), output.length());

This results in data not being sent to the socket.

Looking through the rest of the project, I can see that anywhere the T2A macro is used, that
portion of code is commented out.  I'm have not been able to locate the T2A definition, and
so can not guess why its usage is being avoided.

If the following code is placed in XMLSocketAppender::renderEvent, the log events will be
transmitted (and received) successfully by Chainsaw V2:

        char * sz = (char *) malloc(output.length() + 1);

        sprintf(sz, "%S", output.c_str());

        os->write((void *)sz, output.length());


I'm fairly certain there is a good reason why T2A usage is being avoided, I just don't know
why.  In the absence of that knowledge all I can claim is that the above code makes the XMLSocketAppender
functional with respect to log events being received by Chainsaw V2; I can not make any claim
about this code's correctness with respect to other aspects of the log4cxx architecture.

The ability to send log events remotely via the XMLSocketAppender is very valueable, and I
hope this functionality can be enabled properly on the projects trunk and subsequent releases.

Thank you,

Albert Kennis
Software Engineer
POS & Kiosk Printer Products
Star Micronics

Tel: +81-543-47-0111
Fax: +81-543-48-9560

View raw message