ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey E Care <>
Subject Re: Logging and synchronization
Date Fri, 11 Jul 2008 18:44:30 GMT
I spent a lot of time & effort writing a thread-safe logger for our own 
internal use. If there's sufficient interest I'd be willing to get the 
ball rolling on getting the contribution approved by our internal IP 


Jeffrey E. (Jeff) Care 
IBM WebSphere Application Server 
WAS Release Engineering 

Stefan Bodewig <>
07/11/2008 12:03 PM
Logging and synchronization

On Fri, 11 Jul 2008, <> wrote:

> XmlLogger could lose messages when parallel is used.

Since DOM is not thread safe (something I didn't fully realize) our
XMLLogger implementation failed to add a few elements when parallel
was used.  I've now synchronized all appendChild calls and it seems to
work OK.

Of course this means XmlLogger will now be synchronized even if you
don't use parallel at all - or fork processes which could generate
messageLogged events from a separate thread, or do anything else that
happens on a separate thread.

Do you think it would be worth it if we added a SynchronizedXmlLogger
and ask people to use that if they intend to do multithreaded things?
Or do we just swallow the performance impact of synchronization?

BTW, all the other loggers are vulnerable to this as well.
DefaultLogger will happily mix log outputs of several messages - in
particular now that trunk no longer serializes the messageLogged


To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message