[logback-user] appenders

Ceki Gülcü listid at qos.ch
Wed Dec 27 23:20:19 CET 2006


Hello,

In case of dropped events, that is when the filter returns DENY and
drops the logging request, the LevelFilter performs significantly
better than the expression-based (Janino) filter.

However, in case the event is logged, that is when the filter accepts
the event it is sent to an appender, the impact of the filter is
negligible compared to the cost incurred in the appender.

Here are some figures:

It takes about 21'000 nanoseconds to write to a file using
FileAppender regardless of the filter type used.

However, when the filter drops events, it takes about 1'400 nanos to
decide to drop the events whereas it takes 2'300 nanos with the
expression-based (Janino) filter.

HTH,

Ceki for Sébastien

ps: The LevelFilter was only recently added and is available only via
our subversion repository.

At 06:11 PM 12/21/2006, you wrote:
>Hello Eric,
>
>Thanks for using logback :)
>
>Appender threshold are not available in logback because the Appender class 
>is in the core module, where there is no concept of level. However, like 
>you correctly mentionned, the use of a filter can provide the 
>functionnality that the threshold offers.
>
>We are right in the process of testing filter performance. If the use of 
>expression based filters is not satisfying in terms of speed, we will add 
>a dedicated filter to cover this use case.
>
>You can expect a more precised and detailled answer within the next 24 
>hours, once I've investigated further.
>
>Cheers,
>
>Sébastien
>
>
>
>
>Eric Yung wrote:
>>Hi,
>>I have migrated from log4j to slf4j and logback. I have one question for 
>>the appender setting. In log4j, you can set the threshold of an appender 
>>so that only a certain level of log messages will be logged by that 
>>appender. But in logback, I can only achieve this behavior by using a 
>>expression filter. I would like to know the performance figure about that 
>>filter. If the expression filter takes much longer than a dedicated log 
>>level filter, I would like to see a simple log level filter be included 
>>in logback.
>>
>>Thanks,
>>Eric
>>_______________________________________________
>>Logback-user mailing list
>>Logback-user at qos.ch
>>http://qos.ch/mailman/listinfo/logback-user
>
>--
>Sébastien Pennec
>sebastien at qos.ch
>
>Logback: The reliable, generic, fast and flexible logging framework for Java.
>http://logback.qos.ch/
>_______________________________________________
>Logback-user mailing list
>Logback-user at qos.ch
>http://qos.ch/mailman/listinfo/logback-user

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch




More information about the Logback-user mailing list