logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Smith <paul.sm...@lawlex.com.au>
Subject Re: [PATCH] add 'timeStampFormat' property to HTMLLayout
Date Wed, 07 Jan 2004 23:24:19 GMT

> This sounds good, but SimpleDateFormat is not thread-safe.  So it would 
> not be a good idea to share an instance without some sort of 
> synchronization.  (I'm assuming that log4j won't supply this 
> automatically.)  So it becomes a question of where do you want the 
> performance hit: garbage collection or synchronization?

This is true, but a Layout instance is not shared within Log4j, and
since an appender sync's it's own doAppend method, I believe there would
be enough syncronization to protect it.

It might be good to have documentation that the HTMLLayout class is not
Threadsafe if the optional dateFormat pattern is used (unless
specifically protected by the surrounding appender).

cheers,

Paul Smith


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


Mime
View raw message