[logback-user] Clustered environment + cluster switch

Alex Vb i8c.alex at gmail.com
Wed Sep 15 13:37:26 CEST 2010

The setup is 2 windows servers that have a clustered disk whos ownership can
be transferred from one server to the other.
Each server is using logback with a rolling file appender in prudent mode to
write to a file. Everything works great until you transfer the ownership of
the disk.
After that, whatever is written to the log file seems to go nowhere and much
much worse: for some reason in some circumstances (which i have been able to
replicate generally but not pin down accurately), after the cluster switch
is done, calling a logger service will hang the thread indefinately. I think
i have been able to track down the problem to the locking mechanism used by
the safe write method, the lock() seems to hang forever. Somehow the file
lock was kept in memory, a JVM reboot fixes the problem.

Currently we log asynchronously (behind a JMS-like messaging system), so
there is only one server writing to the log file at the same time (though
impossible to say which one). Because of this I am thinking of writing a
custom appender that:
- opens & closes a fileoutputstream each time (performance is less of an
- does not lock the file because the servers are guaranteed to process

Any thoughts on the matter?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20100915/a142f2b3/attachment.html>

More information about the Logback-user mailing list