here is an improved patch - it does printout all the log messages in the
case when Logging service fails to initialize.

fedor.

-------------------------------
"That's one small step for man, one giant leap for mankind." - Jesus Christ,
the sea of Tiberias

> -----Original Message-----
> From: Fedor Karpelevitch [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 08, 2001 2:43 PM
> To: Turbine-Dev (E-mail)
> Subject: [PATCH] turbine logging before logging service is initialized
> 
> 
> Hi!
> 
> Here is the problem: before the logging service is 
> initialized and enabled
> Turbine.java logs using standard servlet logging (which 
> happens to be stdout
> when running standalone) and TurbineServices.java logs to 
> stdout. Sometimes
> getting those few messages in the output may be annoying and 
> sometimes is a
> real problem, for example if you producing some output for 
> another program
> to pipe in and parse (which is the case for me). I believe the normal
> behaviour would be to _always_ use turbine logging facilities.
> 
> So here is what this patch does:
> 
> 1. Turbine.java overrides servlet's log methods and calls 
> TurbineServices'
> logging methods, so all servlet logging goes to Turbine logging
> 
> 2. Changed TurbineServices' logging methods so that, when 
> logging service is
> not yet initialized the messages are cached in memory instead of being
> printed to stdout. As soon as logging service is initialized 
> and enabled all
> the cached messages are dumped into the logger, so they are not lost.
> 
> 3. In case we never get to successfully initialize logging service we
> attempt to dump the cached messages in the finalizer of 
> TurbineServices. I
> could not find a better place to do that.
> 
> This is the cleanest solution I could come up with. I hope it is clean
> enough. Let me know if there is any problem with this or if you know a
> better way.
> If nobody has any problem could someone please commit it or 
> i'll commit it
> in a while.
> 
> fedor.
> 
> -------------------------------
> Amicus Plato amicus Aristoteles magis amica veritas
> 
> 

Attachment: torque7.diff
Description: Binary data

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

Reply via email to