logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Ebersole" <steveebers...@austin.rr.com>
Subject Re: Directing SocketAppender output to a File
Date Fri, 04 Jan 2002 11:59:17 GMT
Are you planning on using the included SocketServer/SocketNode combination
on the server side?

If so, it's normal operation is to set up loggers by the incoming ip address
of the client.  If you really want to log everything coming to the socket in
this setup, then just use the root logger/category on the server side:
log4j.rootLogger=DEBUG, R1   -or-   log4j.rootCategory=DEBUG, R1

To direct LoggingEvents to seperate files based on the Category/Logger of
the incoming event would require you to do some coding, but would not be
that difficult.  Just write a class to handle the incoming socket connection
requests and then the logging requests on that connection using
ServerSockets.  Then, somehow decide to which file to log based on the
incoming LoggingEvent.logger (this is the fields name in the new 1.2
version, not sure what it's named in 1.1.3 and earlier).  Look at the
supplied SocketServer and SocketNode classes if you need help.

----- Original Message -----
From: "Balaraman Sujatha" <sujathab@cisco.com>
To: <log4j-user@jakarta.apache.org>
Sent: Thursday, January 03, 2002 7:28 PM
Subject: Directing SocketAppender output to a File

> Hi,
> I am trying to use the SocketAppender to log messages from various JVM's
> a single log file.
> On the Client side, I have defined a SocketAppender as follows:
> --------------------------------------------------------------------------
> # Set ctm category priority to ERROR and its appender to A2.
> log4j.category.ctm=DEBUG, A1, A2
> #This is so that the SocketNode receives all messages with priority FATAL
> and above.
> log4j.category.org.apache.log4j.net.SocketNode=FATAL
> #A2 is the SocketAppender
> log4j.appender.A2=org.apache.log4j.net.SocketAppender
> log4j.appender.A2.RemoteHost=localhost
> log4j.appender.A2.Port=8888
> --------------------------------------------------------------------------
> On the server side, I am not too sure, which category, should be assigned
> the priority and appenders. I want to log all the messages coming into the
> socket at the server side into a file.
> Esesntially what I want to know is :
> log4j.category. ????=DEBUG, R1
> where R1 is a rolling file appender.
> Can U please help me here.
> Also, is there a way to log the log information coming into the socket
> a socketappender, into separate files, depending on the sending category ?
> Thanks.
> Sujatha.
> ---------------

To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>

View raw message