Hi Roy,

I guess my mail is a little bit misleading :)

It's totally fine to use SLF4J directly and we should keep doing this. Under the covers, everything you log to slf4j is routed through the LogService so other components in the system can listen to log entries etc.

So this is about keeping everything as is for clients doing logging but just replace the LogService implementation with the Apache Felix one - and make sure that we still have todays features in place.


Am 15.08.2019 um 09:22 schrieb Roy Teeuwen:
Hey Carsten,

What is the benefit of using this log service instead of just keep using SLF4J 
which seems to have almost the exact same interface / way of using?


On 14 Aug 2019, at 08:17, Carsten Ziegeler <cziege...@apache.org> wrote:


the OSGi R7 specification has an update to the Log Service which we should 
support in some way in Sling.

Today, we have our own LogService implementation 
(org.apache.sling.commons.logservice). One way to implement R7 could be to 
simply update our implementation. However logging is not our core business, so 
I think it makes more sense to use an existing implementation.

Fortunately, the Apache Felix project has an R7 LogService implementation. So 
we could replace our own implementation with that.

Unfortunately, that's not a simple replacement as our commons.logservice is 
also implementing slf4j support by logging every received log event to slf4j. 
On the other hand we have slf4j support in our org.apache.sling.commons.log 
bundle (it's easy to confuse these two bundles we have). So we could move the 
slf4j support to that bundle as well and have everything in a single place.

Or we could remove our own logservice implementation from the logservice bundle 
and just keep the slf4j support there. That would be a little bit more 

Just for completeness, the R7 log service specification also introduces 
streaming support for logging. The Apache Felix implementation does not support 
this. But as the streaming support is additional we can use the Eclipse log 
stream implementation on top of Felix implementation if we want to support 
that, too.


Carsten Ziegeler
Adobe Research Switzerland

Carsten Ziegeler
Adobe Research Switzerland

Reply via email to