You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by wuhao <wu...@hotmail.co.jp> on 2008/10/22 15:38:23 UTC

Log4j output empty line on Solaris 10 (4 CPU)

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!
-- 
View this message in context: http://www.nabble.com/Log4j-output-empty-line-on-Solaris-10-%284-CPU%29-tp20110914p20110914.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4j output empty line on Solaris 10 (4 CPU)

Posted by Curt Arnold <ca...@apache.org>.
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: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org