logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bender Heri" <HBen...@Ergonomics.ch>
Subject RE: Same configuration file for application running in different JVMs
Date Wed, 28 Jun 2006 13:43:53 GMT
Imagine: Two processes own a file handle to the same file. I wonder that not already the concurrent
writing gives problems. But if one process wants to rename the file, this can't become good
in each case. (this is a OS and Filesystem issue and not a Log4j issue).

If you want two JVM writing to the same log file, try SocketAppenders which work together
with one receiver App.

Heri

> -----Original Message-----
> From: Pavan Sara (CONS), IT [mailto:sara.pavan.oa@pirelli.com]
> Sent: Wednesday, June 28, 2006 3:28 PM
> To: Log4J Users List
> Subject: Same configuration file for application running in different
> JVMs
> 
> 
> Hi all,
> I'm using Log4j (log4j-1.2.9.jar) for two applications (two JVMs)
> which use the same configuration file and write onto the same 
> log files.
> Traces seem correct, but the RollingFileAppender doesn't work. 
> There's no backup file but the log is reset when max size is reached.
> 
> I've recreated the "same" error using only one application, but
> with two appenders writing onto the same file (for example with
> a layout different).
> 
> In particular the problems seem to be:
> 1) the "renameTo" method fails;
> 2) the condition when applying rollOver is not updated.
> 
> I extended the RollingFileAppender with a class which:
> - overloads rollOver() method (replacing the "renameTo" call) 
> - overloads subAppend() method (performing a refresh of file features 
>   before doing the check of its size).
> 
> The situation is certainly improved, but there are still some bugs
> because sometimes some files are smaller and some traces miss.
> 
> Any suggestions?
> What am I doing wrong?
> I've also looked at log4j-1.2.13.jar, but its behaviour seem the same.
> 
> Thanks,
> S.
> 
> ===================================
> Sara Pavan
> Software Developer
> ONE-ANS
> 
> email: sara.pavan.oa@pirelli.com
> =================================== 
> 
> 
> 
> 
> ========================================================
> CONFIDENTIALITY NOTICE
> 
> This message and its attachments (if any) may contain confidential,
> proprietary or legally privileged information and it is 
> intended only for
> the use of the addressee named above. No confidentiality or privilege
> is waived or lost by any mistransmission.
> 
> If you are not the intended recipient of this message you are hereby
> notified that you must not use, disseminate, copy it in any 
> form or take
> any action in reliance on it. If you have received this 
> message in error,
> please, delete it (and any copies of it) and kindly inform 
> the sender, of this
> e-mail, by replying or go to www.pirelli.com on "contact us".
> ========================================================
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message