No, you don't want two -or more processes- writing to the same file.

You have several options:

a) Aggregate on demand.
   Keeps the log files independent, but only merge them when needed.
b) Send the log records over the network to one or more logging servers
   This will merge your logs on the fly.

For (b), you may use Log4j SocketAppender.

Take a look at Apache Hadoop (Chukwa).


On Fri, Nov 20, 2009 at 4:39 AM, Aleksandar Stoisavljevic <stal...@gmail.com
> wrote:

> Hi all,
>
> I am preparing myself for my first commercial application in clustered
> Tomcat environment.
>
> One of requests that I have is to allow exposing logs that happened on
> either TomcatA or TomcatB aggregated in single report. TomcatA and TomcatB
> are behind Apache Server and load balancing should be used.
>
> Until now I developed web applications just for single Tomcat, or in case
> that Load Balancing is requested no-one asked for such kind of aggregated
> report.
>
> My guess is that some kind of central repository for Logging should be used
> (TomcatA and TomcatB can access to that central repository and write
> thier logs there) but I am wondering what about permissions? What is
> TomcatA
> is writing to log and TomcatB should log to same log his stuff?
>
> Any experience about this matter? Can You point me out some inet address,
> blog, book ?
>
> Thanks in advance ?
>
> --
> Aleksandar dipl. ing. Stoisavljevic
> Software Developer
> mobile: +381 (0) 64 211 50 40
> Web: http://www.staleksit.in.rs
> E-mail:stal...@gmail.com <e-mail%3astal...@gmail.com> <
> e-mail%3astal...@gmail.com <e-mail%253astal...@gmail.com>>
> Mail: Branislava Nusica 10, 21000 Novi Sad, Serbia
>

Reply via email to