cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: New log formatter
Date Tue, 24 Jul 2001 12:07:47 GMT


Stuart Roebuck a écrit :
> 
> Any thoughts on the performance penalties of extra log functionality like
> this?  I suspect the class feature (nice as it is) may be doing quite a
> lot of extra work.
> 
I didn't measure it, but it should cause no harm. Here's how it works :

- first of all, formatting occurs only when an event is logged.
Otherwhise, the extra cost is only adding the environment (an HashMap)
on top of LogKit's context stack (a java.util.Stack) for each request.

- if (and only if) formatting occurs, the class is found by calling a
native method in SecurityManager that returns the call stack as an array
of classes. This method is, I think, heavily used by security policies
each time a permission is checked by the JVM.

- once we have the class array, we iterate on its elements until we find
one that implements Logger. The caller is the previous item in the
array. Et voila !

> Stuart.
> 

-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message