On Oct 22, 2008, at 8:38 AM, wuhao wrote:


Hello Everyone, Hope you have a nice day.
I am using log4j 1.2.15 on Solaris 10 which has 4 cpu. When I simultaneously
executed 2 java programs that
output to the same log file, the log4j output a empty line and didn't output
some messages that were supposed to be writed to the log file.
When I tested this on one cpu Solaris machine, this phenomenon never
happened. Is it because of multiple
cpu?
How can I solve this problem?

Any of your help and suggesution will be a big help to me.

Thanks a lot!

java.io does not offer any guarantees around simultaneous writes to the underlying file, so users should avoid multiple instances of FileAppender or derivatvies from writing to the same log file.

I believe that java.nio does and have hoped to work on a java.nio based FileAppender analog, but have not had time to work on it. If you'd be interested in testing it, I could take a shot at getting started.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to