Re: log4j and log file lock?



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

.



Relevant Pages

  • log4j and log file lock?
    ... We have a processor farm (currently 8 machines) running the same ... We use log4j to record ... we'd like to use a single log file in a networked ... incomplete messages, duplicate messages....). ...
    (comp.lang.java.programmer)
  • Re: XP to Vista -- only halfway there
    ... concerning networks that combine Vista and XP machines. ... I am setting up an inhouse network that links together three machines, ... by 1) a misconfigured firewall or overlooked firewall (including stateful ...
    (microsoft.public.windows.vista.networking_sharing)
  • Re: Forensic Survey, help needed for a research/training program
    ... forensics or network based forensics? ... Host based forensic questions ... system rather than shutting it down or disconnecting it from the network? ... Given a log file for an incident, what can you look for to determine ...
    (Security-Basics)
  • Forensic Survey, help needed for a research/training program
    ... forensics or network based forensics? ... Host based forensic questions ... system rather than shutting it down or disconnecting it from the network? ... Given a log file for an incident, what can you look for to determine ...
    (Security-Basics)
  • Re: SBS 2003 Win XP/2000 Pro Clients TCP/IP Problems
    ... network and no DHCP services provided by any machines still on the network. ... Check all machines for DNS entries. ... It really sounds like a IP Address conflict the way the server stops ... > PCs, 3 of which are running Windows XP Pro, the rest 2000 Pro. ...
    (microsoft.public.windows.server.sbs)