[slf4j-dev] slf4j i8ln

Ceki Gulcu ceki at qos.ch
Tue Aug 25 10:32:29 CEST 2009



Ralph Goers wrote:
> 
> On Aug 24, 2009, at 1:25 PM, Ceki Gulcu wrote:
> 
>>
>>
>> Takeshi Kondo wrote:
>>> Hi Ceki
>>>> The fact that it can't be done in log4j does not mean that it can't 
>>>> be done.
>>> Is it mean that it can be done in logback?
>>> If it is, I'll change logger to logback.
>>
>> To be honest, at present time it can't be done in logback either. 
>> However, logback already has support for TurboFilters [1] which can 
>> already do arbitrary filtering. We'd need to enhance turbo filters so 
>> that they influence the contents of the logging event. My point is 
>> that the hook is already there, it needs to be enhanced.
>>
> 
> 
> What would need to be enhanced? Turbo Filters have access to the event 
> and as far as I recall the event is not immutable. However, this becomes 
> highly dependent on filters being run in the correct order.

At the time a turbo filter is called there is no event yet. The event
is created after all the turbo filters are called (assuming none
denied the request). As for immutability, most fields in a
LoggingEvent are immutable.

Yes, the down side of having many filters is that they depend on their
order of execution. The same principle applies in networking which
explains why network filters are so damn fragile.

> Ralph

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



More information about the slf4j-dev mailing list