When you say client group, do you mean different machines that are using
socketAppender?

If that is the case, you can give a directory as a command line argument
(see javadoc on SocketServer) to socketServer. In this dir you can put
several config files (hostname.lcf i.e, 192.215.113.16.lcf). The
socketserver will read the appropriate config file and use it to log
loggingEvent coming from the particular host. This way you can specify
different files/appenders in each of the lcf files and the log will go to
different files depending on the 'client group'

Hope this helps :)

-----Original Message-----
From: Atte A [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 13, 2001 6:37 AM
To: [EMAIL PROTECTED]
Subject: Multiple log files with SocketServer


Hi!      (Using Visual Age 3.5 on NT)

I use SocketAppender and listen with SocketServer which logs to a file. It 
works well. But now I want to log to several files on server, depending on 
which "client group" that want to log.

I use the SocketAppender in the following prop. config file (Trace1.lcf):

log4j.rootCategory=DEBUG, SOCKETSERV

log4j.category.org.apache.log4j.net=DEBUG
log4j.appender.SOCKETSERV=org.apache.log4j.net.SocketAppender
log4j.appender.SOCKETSERV.RemoteHost=localhost
log4j.appender.SOCKETSERV.Port=9991


I do the following in a method everytime to send messages to the socket:
  PropertyConfigurator.configure("C:\\Trace1.lcf");

  Category cat = Category.getInstance("SOCKETSERV");

  cat.info("Tracing" + message);

Is this the right way to do so?


I have the following prop. config file (localhost.lcf) stated in 
SocketServer second argument in main():

  log4j.rootCategory=debug, A1

  log4j.appender.A1=org.apache.log4j.RollingFileAppender
  log4j.appender.A1.File=C:\\localhost.log

  log4j.appender.A1.MaxFileSize=1000KB
  # Keep one backup file
  log4j.appender.A1.MaxBackupIndex=5

  log4j.appender.A1.layout=org.apache.log4j.PatternLayout
  log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss.SSS} - %m%n%n


Every "client group" have to have a logfile that only belongs to that group.

How can I log to diffent files in SocketServer, one for each "client group"?

Do I have to have several SocketAppenders stated in my config file, one for 
each "client group"?

Please...Help me...Don't hesitate to contact med directly.

/Atte
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to