Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [riena-dev] Cache for LOGGER.isLoggable

Hi Patrick,

thanks for bringing that up.

I'm not the expert in this area (committer Stefan is) but I agree that
isLoggable(...) should be fast.

However: could you provide some information about where the code that
does the searching comes from? Are you referring to
ExtendedLogReaderServiceFactory.isLoggable(...) or something else? In
the first case: that class is part of the Equinox logging framework so
you should propably open a bug or talk with them:

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Equinox
http://eclipse.org/equinox/resources.php

Thanks,
Elias.


On Sat, Jul 10, 2010 at 7:20 PM, Patrick <platinas.hy@xxxxxxxxx> wrote:
> Hi riena-dev,
>
>
>
> When we use Log4r.getLogger() to get a logger, there is a method
> isLoggable(int level). Using debugger to track turns out that it looks like
> every time this method is called, it consults every registered log listener
> to ask if this log level is loggable, which looks like is resource consuming
> if there are many service enquiring if the log level is available.
>
>
>
> The isLoggable method should be a quick one that pre-checks if the log level
> applies to current environment, as sometimes dumping log data is quite
> resource consuming and not needed in production mode.
>
>
>
> Maybe it is good to introduce some cache for the isLoggable method as there
> are just a few log levels and the result is not likely to change in
> application execution time.
>
>
>
> Thanks for any thoughts.
>
>
>
> Regards,
>
>
>
> Patrick He
>
>
>
> _______________________________________________
> riena-dev mailing list
> riena-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/riena-dev
>
>



-- 
Elias Volanakis | Technical Lead | http://eclipsesource.com
elias@xxxxxxxxxxxxxxxxx | +1 503 929 5537 | @evolanakis


Back to the top