You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Christian Schneider <ch...@die-schneider.net> on 2017/03/01 21:36:33 UTC

Re: [Discuss] Do we need to support other logging frameworks in felix framework?

I just had an idea that might solve the problem of being flexible about 
the logger while not using reflection.

How about using the LogService interface to provide an adapter to an 
arbitrary logger?

We use the FrameworkFactory config to specify a logger. Either as an 
object if that is possible or as a class name given by the caller.
The logger must implement LogService and can then internally bridge to 
any logging framework.

Using the well known LogService interface would allow to avoid 
reflection and we also do not need to change the spec. Of course the 
spec could still be changed to standardize how to specify a logger like 
this but we could easily already start just in felix.


Christian


On 24.02.2017 15:32, Christian Schneider wrote:
> Currently felix framework uses reflection to allow other logging 
> frameworks. It is a quite complicated and still pretty limited approach.
> As far as I know this is only used for karaf to hook in. So I propose 
> to only allow to choose jul as it is built in and we can avoid to add 
> dependencies as well as avoid to use reflection.
>
> https://issues.apache.org/jira/browse/FELIX-5525
>
> Karl reviewed the change and is generally positive but we would like 
> to get feedback from the community if this is a good idea.
>
> Christian
>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: [Discuss] Do we need to support other logging frameworks in felix framework?

Posted by li...@io7m.com.
On 2017-03-02T11:18:14 +0100
Guillaume Nodet <gn...@apache.org> wrote:
>
> I don't think anyone uses the reflection stuff but Karaf.  At least, I was
> the only one complaining about it when it was removed in 5.0 until I
> restored it in 5.6.   If anybody does, please speak up now !
> 

I pass in my own implementation of Felix's logger interface in order to
capture all of the framework's messages (and pipe them to SLF4J). Does
that count as use of reflection?

I actually wrote a small article on it a while back:

http://io7m.com/documents/brutal-felix-logging/

I don't mind API breaking changes as long as I can still capture all of
the framework's messages afterwards.

M

Re: [Discuss] Do we need to support other logging frameworks in felix framework?

Posted by Guillaume Nodet <gn...@apache.org>.
2017-03-01 23:56 GMT+01:00 David Jencks <da...@gmail.com>:

> I’m not sure what’s happening with the log service in R7, but in R6 it
> appears in the cmpn rather than core spec.  It might be a bit confusing for
> the framework to contain the LogService interface but not export it.
>
> What exactly is wrong with using jul?  Aren’t there lightweight adapters
> available for everyones choice of favorite log service?
>

I do agree.  There's a simple standard which is provided by the JVM and
that people are used to plug into to provide their own backend using
logback or log4j for example.

I don't think anyone uses the reflection stuff but Karaf.  At least, I was
the only one complaining about it when it was removed in 5.0 until I
restored it in 5.6.   If anybody does, please speak up now !

The goal of FELIX-4845 <https://issues.apache.org/jira/browse/FELIX-4845> was
to clean up the code.  It went a bit too far and removed the way to
actually have any saying over the logging framework.  Using should solve
that problem and keep the code clean.


>
> david jencks
> > On Mar 1, 2017, at 1:36 PM, Christian Schneider <ch...@die-schneider.net>
> wrote:
> >
> > I just had an idea that might solve the problem of being flexible about
> the logger while not using reflection.
> >
> > How about using the LogService interface to provide an adapter to an
> arbitrary logger?
> >
> > We use the FrameworkFactory config to specify a logger. Either as an
> object if that is possible or as a class name given by the caller.
> > The logger must implement LogService and can then internally bridge to
> any logging framework.
> >
> > Using the well known LogService interface would allow to avoid
> reflection and we also do not need to change the spec. Of course the spec
> could still be changed to standardize how to specify a logger like this but
> we could easily already start just in felix.
> >
> >
> > Christian
> >
> >
> > On 24.02.2017 15:32, Christian Schneider wrote:
> >> Currently felix framework uses reflection to allow other logging
> frameworks. It is a quite complicated and still pretty limited approach.
> >> As far as I know this is only used for karaf to hook in. So I propose
> to only allow to choose jul as it is built in and we can avoid to add
> dependencies as well as avoid to use reflection.
> >>
> >> https://issues.apache.org/jira/browse/FELIX-5525
> >>
> >> Karl reviewed the change and is generally positive but we would like to
> get feedback from the community if this is a good idea.
> >>
> >> Christian
> >>
> >
> >
> > --
> > Christian Schneider
> > http://www.liquid-reality.de
> >
> > Open Source Architect
> > http://www.talend.com
> >
>
>


-- 
------------------------
Guillaume Nodet

Re: [Discuss] Do we need to support other logging frameworks in felix framework?

Posted by David Jencks <da...@gmail.com>.
I’m not sure what’s happening with the log service in R7, but in R6 it appears in the cmpn rather than core spec.  It might be a bit confusing for the framework to contain the LogService interface but not export it.

What exactly is wrong with using jul?  Aren’t there lightweight adapters available for everyones choice of favorite log service?

david jencks
> On Mar 1, 2017, at 1:36 PM, Christian Schneider <ch...@die-schneider.net> wrote:
> 
> I just had an idea that might solve the problem of being flexible about the logger while not using reflection.
> 
> How about using the LogService interface to provide an adapter to an arbitrary logger?
> 
> We use the FrameworkFactory config to specify a logger. Either as an object if that is possible or as a class name given by the caller.
> The logger must implement LogService and can then internally bridge to any logging framework.
> 
> Using the well known LogService interface would allow to avoid reflection and we also do not need to change the spec. Of course the spec could still be changed to standardize how to specify a logger like this but we could easily already start just in felix.
> 
> 
> Christian
> 
> 
> On 24.02.2017 15:32, Christian Schneider wrote:
>> Currently felix framework uses reflection to allow other logging frameworks. It is a quite complicated and still pretty limited approach.
>> As far as I know this is only used for karaf to hook in. So I propose to only allow to choose jul as it is built in and we can avoid to add dependencies as well as avoid to use reflection.
>> 
>> https://issues.apache.org/jira/browse/FELIX-5525
>> 
>> Karl reviewed the change and is generally positive but we would like to get feedback from the community if this is a good idea.
>> 
>> Christian
>> 
> 
> 
> -- 
> Christian Schneider
> http://www.liquid-reality.de
> 
> Open Source Architect
> http://www.talend.com
>