The setup is 2 windows servers that have a clustered disk whos ownership can be transferred from one server to the other.<br>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.<br>
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.<br>
<br>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:<br>
- opens & closes a fileoutputstream each time (performance is less of an issue)<br>- does not lock the file because the servers are guaranteed to process serially<br><br>Any thoughts on the matter?<br>