Hello,

I followed the approach using a SocketAppender now.

I am starting a SocketServer via the following commandline:
java org.apache.log4j.net.SocketServer port configFile configDir

I have incorporated this commandline in the script that also starts my other 3 
processes.

1) Do you know if there is some commandline interface that can be used to stop the 
socket server?

2) Or is there only the possibility to kill the socketserver process?


-----Original Message-----
From: Keith Hatton [mailto:[EMAIL PROTECTED]
Sent: Montag, 26. Juli 2004 17:04
To: Log4J Users List
Subject: RE: using log4j to one logging file from more than one process


You might also consider using system-level logging (e.g. with NTEventLogAppender or 
SyslogAppender, depending on the platform) or a SocketAppender from each application 
to a listener in a fourth JVM on the box.

Keith


-----Original Message-----
From: Dennis Cook [mailto:[EMAIL PROTECTED]
Sent: 26 July 2004 15:59
To: Log4J Users List
Subject: Re: using log4j to one logging file from more than one process


Here is one approach that might work.

If the three processes can be started by a single common java process, 
then you could use console appenders from those three processes and 
collect there entries in the starting process by intercepting their 
stdout and stderr streams; in turn writing to a file appender from that 
process.

On Jul 26, 2004, at 7:35 AM, Bartsch Axel wrote:

> Hello,
>
> I want to write into a logging file with log4j from an application 
> that consists of 3 processes (=JAVA VMs).
>
> Each process calls
>
> String configFileName = "log.properties";
> PropertyConfigurator.configure(configFileName);
> tfl = Logger.getLogger("debug");
>
> and then logs e.g. with
> tfl.debug("hello");
>
> The loggging file gets corrupted:
> - each process writes into it, after a while 0Hex whitespace is added 
> to the logging file
> - there is output-process1, whitespace, output-process2, whitespace, 
> output-process3, whitespace
> - some trace outputs are missing
> -timestamps start new with each output-processX
>
> Is it possible to use log4j for wrting into the same file for multiple 
> processes (=JAVA VMs).
>
> Axel
>
> ---------------------------------------------------------------------
> 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]


---------------------------------------------------------------------
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