On Thu, 2004-01-08 at 08:16, Bauer, Paul-Michael wrote:
Sorry and Thank you.
I'd like to propose an enhancement to org.apache.log4j.HTMLLayout. The current version prints the difference in milliseconds between an event's timestamp and the application start time.
Thank you for proposing the patch. I think that the feature definitely
has merit, however I have an issue with the implementation.
For every output of a LoggingEvent, a NEW SimpleDateFormat instance is created. It would be better if the date format instance was created an initialised within the activateOptions method (part of the OptionHandler interface).
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?
Ray
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
