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: Can find Vista box, cant share folders or printers.
    ... When I click 'Network' on the laptop the ... I've disabled Norton and Windows firewall entirely to make sure that's not ... public folder sharing - on ... start by running the Network Setup Wizard on all machines (see ...
    (microsoft.public.windows.vista.networking_sharing)
  • 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: Audacity and Gentoo
    ... can only pick up radio 4 when using the TV aerial to ... I freak if my machines disagree by more than about 50 ... > ADSL cable, 2 power cables, one network ...
    (uk.comp.os.linux)
  • Re: Active Directory Setup Advice
    ... A domain is really an entity with a single security remit. ... seen as on the same network it will be like one big network. ... Under one domain all machines have to be unique in naming scheme. ... sub domains you can have same names under different domain. ...
    (microsoft.public.windows.server.active_directory)