Re: log4j and log file lock?
- From: Manish Pandit <pandit.manish@xxxxxxxxx>
- Date: Wed, 15 Aug 2007 19:04:16 -0700
On Aug 15, 2:25 pm, alejandrina <apat...@xxxxxxxxx> wrote:
Hi all,
We have a processor farm (currently 8 machines) running the same
application with different input parameters. We use log4j to record
interesting stuff; we'd like to use a single log file in a networked
disk. We noticed that the 8 machines are trampling on each other as
they write to the log file (symptoms are nulls embedded in messages,
incomplete messages, duplicate messages....). I have assumed that this
is because access to the log file is not "locked" (using something
like Java's FileLock API).
Is there a solution to this problem? Thread syncronization is not an
option, of course, as these are different computers.
Thanks for any ideas,
Alejandrina
You can also look at the SocketAppender/SimpleSocketServer (It is in
the same package as the Syslog appender mentioned by Owen.)
http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/package-summary.html
I've seen SocketAppender+SimpleSocketServer being used at several
instances which are similar to your setup. One thing to be careful
about is the message rate; which, if faster than the network
(connection to the server), will cause the client to block.
-cheers,
Manish
.
- Follow-Ups:
- Re: log4j and log file lock?
- From: alejandrina
- Re: log4j and log file lock?
- From: alejandrina
- Re: log4j and log file lock?
- From: Lew
- Re: log4j and log file lock?
- References:
- log4j and log file lock?
- From: alejandrina
- log4j and log file lock?
- Prev by Date: Re: try catch statement
- Next by Date: Re: Is It Possible to Make Java Find a File on Your Computer?
- Previous by thread: Re: log4j and log file lock?
- Next by thread: Re: log4j and log file lock?
- Index(es):
Relevant Pages
|
|