On May 7, 2009, at 2:09 AM, Knut Urdalen wrote:

2) LoggerAppenderSocket is a bit more complicated. It uses fsockopen() to connect to a socket. I have written an example using PEAR::Net::Server [4] (see examples/client.php and examples/ server.php) that I've used as a experimental central logging server before. I think it's possible to write a unit test case here which startup the socket server and connect with a client (but you need to manage two different processes here which is hard in PHP, I only know about the pcntl-extension [] used for spawning processes on *nix). If you write a test case for this remember to use self::markTestSkipped('With some useful message'); [6] if the test case is unable to run because of missing dependencies.


I haven't looked at this, but I'm guessing that its wire format is not compatible with Chainsaw and log4j since they used their easiest implementation (Java serialization). log4cxx 0.9.7 had its own wire format, but it was dependent on the encoding, sizeof(int) and endianess so you had to match senders and receivers. In the current log4cxx, I've mimicked a valid Java serialization byte sequence and it can interact with Chainsaw and other tools that consume log4j serialized events. I think bringing that same approach over would likely make LoggerAppenderSocket more useful. If there is an existing receiver that depends on the current wire format, log4j compatible could be made as an option.

Reply via email to