[logback-user] Logback or Log4J Servers and Log4Cxx client

Greg Flex greg.flex at gmail.com
Thu Nov 20 21:07:15 CET 2008


No I was testing the Log4Cxx client with both the Lockback server and the
Log4j server. (just to see it the Log4j works with it)
(Ideally I'd like the Logback server communicate with the Log4cxx client. Is
this possible?)
(Basically I need Log4cxx logs along with the Logback logs intercepted by
the Logback server.)
Both servers, the Logback's SimpleSocketServer and Log4j's ShortSicketServer
are throwing an exeption below:

2008-11-20 11:59:06,860 ERROR [Thread-0] [SocketNode.java:61] SocketNode -
Could not open ObjectInputStream to Socket[addr=/127.0.0.1
,port=2580,localport=6000]
java.io.StreamCorruptedException: invalid stream header: 3C6C6F67
    at
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
    at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
    at SocketNode.<init>(SocketNode.java:59)
    at SimpleSocketServer.run(SimpleSocketServer.java:83)
2008-11-20 11:59:06,860 INFO  [Thread-0] [SimpleSocketServer.java:79]
SimpleSocketServer - Waiting to accept a new client.
2008-11-20 11:59:06,860 ERROR [Thread-1] [SocketNode.java:96] SocketNode -
Unexpected exception. Closing connection.
java.lang.NullPointerException
    at SocketNode.run(SocketNode.java:78)
    at java.lang.Thread.run(Thread.java:619)
2008-11-20 11:59:06,860 DEBUG [Thread-1] [SimpleSocketServer.java:133]
SimpleSocketServer - Removing SocketNode/127.0.0.1:2580

So I'm wondering if it IS possible to make/mix these two guys. It looks like
there isn't.....
Let me know what you think, I can send you all the files you'd need to test
this.
Thank You
Greg.


On Thu, Nov 20, 2008 at 11:52 AM, Ceki Gulcu <listid at qos.ch> wrote:

>
> I did not know that log4cxx was using ShortSocketServer. Anyway, the short
> socket server expects (java) serialized objects  which can differ from one
> version of log4j to another. The logback and log4j objects for logging
> events
> are not compatible. When you say that you were unsuccessful  in *both*
> cases,
> what is the case other than log4cxx-->logback ?
>
>
> Greg Flex wrote:
> > Hi Ceki,
> > I know this isn't the right place/forum but I've noticed that the
> > Log4cxx is using your server called: ShortSocketServer author: Ceki Gulcu
> > and I'm having problems configuring it to work with Log4Cxx client.
> > I was trying to get the Lockback SimpleSocketServer to communicate with
> > Log4cxx client but I was unsuccessful too and in BOTH cases I got the
> > following error:
> > ERROR  [main] org.apache.log4j.net.SocketNode (SocketNode.java:59) Could
> > not open ObjectInputStream to Socket[addr=/127.0.0.1
> > <http://127.0.0.1>,port=2336,localport=6000]
> > java.io.StreamCorruptedException: invalid stream header: 3C6C6F67
> >     at
> > java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
> >     at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
> >     at org.apache.log4j.net.SocketNode.<init>(SocketNode.java:55)
> >     at
> > org.apache.log4j.net.ShortSocketServer.main(ShortSocketServer.java:74)
> >
> > I thought maybe you could help me out a little... you know more about
> > this than me :-)
> > Is it even possible to mix these two guys and have them talk to each
> > other?
> > Please let me know.
> > Thanks a lot.
> > Greg.
> >
> --
> Ceki Gülcü
> Logback: The reliable, generic, fast and flexible logging framework for
> Java.
> http://logback.qos.ch
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://qos.ch/pipermail/logback-user/attachments/20081120/dcfeee27/attachment.htm 


More information about the Logback-user mailing list