[RT] Support OSGi R7 Logging

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[RT] Support OSGi R7 Logging

Carsten Ziegeler
Hi,

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 compatible.

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.

WDYT?

Regards
Carsten
--
Carsten Ziegeler
Adobe Research Switzerland
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [RT] Support OSGi R7 Logging

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?

Greets,
Roy

> On 14 Aug 2019, at 08:17, Carsten Ziegeler <[hidden email]> wrote:
>
> Hi,
>
> 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 compatible.
>
> 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.
>
> WDYT?
>
> Regards
> Carsten
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [RT] Support OSGi R7 Logging

Carsten Ziegeler
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.

Regards
Carsten

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?
>
> Greets,
> Roy
>
>> On 14 Aug 2019, at 08:17, Carsten Ziegeler <[hidden email]> wrote:
>>
>> Hi,
>>
>> 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 compatible.
>>
>> 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.
>>
>> WDYT?
>>
>> Regards
>> Carsten
>> --
>> Carsten Ziegeler
>> Adobe Research Switzerland
>> [hidden email]
>

--
--
Carsten Ziegeler
Adobe Research Switzerland
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [RT] Support OSGi R7 Logging

Robert Munteanu-2
On Thu, 2019-08-15 at 11:12 +0200, Carsten Ziegeler wrote:

> 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.

+1 from me. I also asked about this a year ago :-)

  https://lists.apache.org/thread.html/581b9ac69bfa6a8692e6bffc98fe5fdd6f5b4c35989d6b53841f7f10@%3Cdev.sling.apache.org%3E

Robert

> Regards
> Carsten
>
> 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?
> >
> > Greets,
> > Roy
> >
> > > On 14 Aug 2019, at 08:17, Carsten Ziegeler <[hidden email]>
> > > wrote:
> > >
> > > Hi,
> > >
> > > 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 compatible.
> > >
> > > 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.
> > >
> > > WDYT?
> > >
> > > Regards
> > > Carsten
> > > --
> > > Carsten Ziegeler
> > > Adobe Research Switzerland
> > > [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [RT] Support OSGi R7 Logging

Carsten Ziegeler
Am 15.08.2019 um 11:21 schrieb Robert Munteanu:

> On Thu, 2019-08-15 at 11:12 +0200, Carsten Ziegeler wrote:
>> 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.
>
> +1 from me. I also asked about this a year ago :-)
>
>    https://lists.apache.org/thread.html/581b9ac69bfa6a8692e6bffc98fe5fdd6f5b4c35989d6b53841f7f10@%3Cdev.sling.apache.org%3E
>
That's actually a different ask :)

We have o.a.s.commons.logservice which is an OSGi R6 LogService
implementation *and* a log listener logging everything to slf4j. My
suggestion is to replace the LogService impl with Apache Felix Log and
keep the listener.

Our logback integration is o.a.s.commons.log which I think is similar to
the logback stuff in Apache Felix.

Now maybe we can replace all of our stuff with the things from Felix?

Carsten
--
Carsten Ziegeler
Adobe Research Switzerland
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [RT] Support OSGi R7 Logging

Karl Pauls
On Thu, Aug 15, 2019 at 11:38 AM Carsten Ziegeler <[hidden email]> wrote:

>
> Am 15.08.2019 um 11:21 schrieb Robert Munteanu:
> > On Thu, 2019-08-15 at 11:12 +0200, Carsten Ziegeler wrote:
> >> 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.
> >
> > +1 from me. I also asked about this a year ago :-)
> >
> >    https://lists.apache.org/thread.html/581b9ac69bfa6a8692e6bffc98fe5fdd6f5b4c35989d6b53841f7f10@%3Cdev.sling.apache.org%3E
> >
> That's actually a different ask :)
>
> We have o.a.s.commons.logservice which is an OSGi R6 LogService
> implementation *and* a log listener logging everything to slf4j. My
> suggestion is to replace the LogService impl with Apache Felix Log and
> keep the listener.

I think that would be a good start! +1

> Our logback integration is o.a.s.commons.log which I think is similar to
> the logback stuff in Apache Felix.
>
> Now maybe we can replace all of our stuff with the things from Felix?

That would be even better - but like I mentioned in thread pointed out
by Robert, I don't know enough about it to say what (or whether) that
is possible.

regards,

Karl

> Carsten
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> [hidden email]



--
Karl Pauls
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [RT] Support OSGi R7 Logging

Robert Munteanu-2
In reply to this post by Carsten Ziegeler
On Thu, 2019-08-15 at 11:38 +0200, Carsten Ziegeler wrote:

> Am 15.08.2019 um 11:21 schrieb Robert Munteanu:
> > On Thu, 2019-08-15 at 11:12 +0200, Carsten Ziegeler wrote:
> > > 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.
> >
> > +1 from me. I also asked about this a year ago :-)
> >
> >    
> > https://lists.apache.org/thread.html/581b9ac69bfa6a8692e6bffc98fe5fdd6f5b4c35989d6b53841f7f10@%3Cdev.sling.apache.org%3E
> >
> That's actually a different ask :)
>
> We have o.a.s.commons.logservice which is an OSGi R6 LogService
> implementation *and* a log listener logging everything to slf4j. My
> suggestion is to replace the LogService impl with Apache Felix Log
> and
> keep the listener.

Re-reading the email makes it clear now :-) And yes, your suggestion
makes sense to me.

>
> Our logback integration is o.a.s.commons.log which I think is similar
> to
> the logback stuff in Apache Felix.
>
> Now maybe we can replace all of our stuff with the things from Felix?

Ideally yes. As Karl pointed out, we need to ensure we have feature
compatibility before switching, and that is going to take some effort.

But small steps first, if we can rip out some of our stuff and use the
Felix ones, I'm all for it.

Thanks,

Robert