You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by LongkerDandy <lo...@gmail.com> on 2010/09/08 06:41:03 UTC

central logging

Hi

I know felix implement the OSGi logging.

But there are also some bundles some other logging util like log4j.

Is that possible to re-direct the log4j api to OSGi logging, so I get a
central view.

Regards
LongkerDandy

Re: central logging

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 08.09.2010 07:47, Guillaume Nodet wrote:
> That sounds really similar to what pax logging does, with the only
> difference is that pax-logging uses an enhanced log4j version to
> support MDC for bundles, etc...

Sure, and in fact we currently considering replacing our own SLF4J SPI
implementation by another one; e.g. Logback for reasons of extended
functionality required/desired by users of Sling.

> 
> One nice thing about pax logging imho is the ability to configure
> everything through CondigAdmin and have it reconfigured on the fly.
> Do you have such a thing in the Sling logging ?

Yes, of course ;-)

Regards
Felix

> 
> On Wed, Sep 8, 2010 at 07:40, Felix Meschberger <fm...@gmail.com> wrote:
>> Hi,
>>
>> There are quite a few solutions available (PAX as mentioned and we have
>> a solution over in Sling [1]). What these generally do is provide APIs
>> for multiple logging systems and route all logging to the implementation
>> of one of these systems, but generally not OSGi LogService.
>>
>> Talking of the Sling logging bundle:
>>  * Log4J, Commons Logging, SLF4J API exposed
>>  * OSGi LogService implemented
>>  * Actual logging based on our own SLF4J SPI implementation
>>
>> Routing logging of the various logging APIs (Log4J, Commons Logging,
>> SLF4J) to the OSGi LogService is not very practical because the
>> LogService does not support the flexible notion of logging categories
>> that these other systems have -- in fact there is one and only one
>> category per bundle in the LogService.
>>
>> HTH
>>
>> Regards
>> Felix
>>
>> [1] http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/log
>>
>> On 08.09.2010 06:41, LongkerDandy wrote:
>>> Hi
>>>
>>> I know felix implement the OSGi logging.
>>>
>>> But there are also some bundles some other logging util like log4j.
>>>
>>> Is that possible to re-direct the log4j api to OSGi logging, so I get a
>>> central view.
>>>
>>> Regards
>>> LongkerDandy
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: central logging

Posted by Guillaume Nodet <gn...@gmail.com>.
That sounds really similar to what pax logging does, with the only
difference is that pax-logging uses an enhanced log4j version to
support MDC for bundles, etc...

One nice thing about pax logging imho is the ability to configure
everything through CondigAdmin and have it reconfigured on the fly.
Do you have such a thing in the Sling logging ?

On Wed, Sep 8, 2010 at 07:40, Felix Meschberger <fm...@gmail.com> wrote:
> Hi,
>
> There are quite a few solutions available (PAX as mentioned and we have
> a solution over in Sling [1]). What these generally do is provide APIs
> for multiple logging systems and route all logging to the implementation
> of one of these systems, but generally not OSGi LogService.
>
> Talking of the Sling logging bundle:
>  * Log4J, Commons Logging, SLF4J API exposed
>  * OSGi LogService implemented
>  * Actual logging based on our own SLF4J SPI implementation
>
> Routing logging of the various logging APIs (Log4J, Commons Logging,
> SLF4J) to the OSGi LogService is not very practical because the
> LogService does not support the flexible notion of logging categories
> that these other systems have -- in fact there is one and only one
> category per bundle in the LogService.
>
> HTH
>
> Regards
> Felix
>
> [1] http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/log
>
> On 08.09.2010 06:41, LongkerDandy wrote:
>> Hi
>>
>> I know felix implement the OSGi logging.
>>
>> But there are also some bundles some other logging util like log4j.
>>
>> Is that possible to re-direct the log4j api to OSGi logging, so I get a
>> central view.
>>
>> Regards
>> LongkerDandy
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: central logging

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

There are quite a few solutions available (PAX as mentioned and we have
a solution over in Sling [1]). What these generally do is provide APIs
for multiple logging systems and route all logging to the implementation
of one of these systems, but generally not OSGi LogService.

Talking of the Sling logging bundle:
  * Log4J, Commons Logging, SLF4J API exposed
  * OSGi LogService implemented
  * Actual logging based on our own SLF4J SPI implementation

Routing logging of the various logging APIs (Log4J, Commons Logging,
SLF4J) to the OSGi LogService is not very practical because the
LogService does not support the flexible notion of logging categories
that these other systems have -- in fact there is one and only one
category per bundle in the LogService.

HTH

Regards
Felix

[1] http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/log

On 08.09.2010 06:41, LongkerDandy wrote:
> Hi
> 
> I know felix implement the OSGi logging.
> 
> But there are also some bundles some other logging util like log4j.
> 
> Is that possible to re-direct the log4j api to OSGi logging, so I get a
> central view.
> 
> Regards
> LongkerDandy
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: central logging

Posted by Guillaume Nodet <gn...@gmail.com>.
Yes, the API bundle is mandatory.

On Wed, Sep 8, 2010 at 08:03, LongkerDandy <lo...@gmail.com> wrote:
> I just installed pas-logging 1.5.0.
> I got this error when starting felix:
> Unresolved constraint in bundle org.ops4j.pax.logging.pax-logging-service
> [8]: Unable to resolve 8.0: missing requirement [8.0] package;
> (&(package=org.apache.avalon.framework.logger)(version>=4.3.0))
>
> so I have to make these api installed, right?
>
> On Wed, Sep 8, 2010 at 1:37 PM, Peter Donald <pe...@realityforge.org> wrote:
>
>> > I know that, it still require a lot of logging bundle installed,
>>
>> As far as I am aware there only needs to be one bundle installed.
>>
>> org.ops4j.pax.logging:pax-logging-api:jar:1.3.0 if you want to support
>> logging from the following apis:
>> * Log4J driving the backend implementation.
>> * Log4J API supported.
>> * Jakarta Commons Logging API supported.
>> * JDK Logging API support.
>> * Avalon Logger API support.
>> * SLF4J API support.
>> * Knopflerfish Log service support.
>> * Tomcat Juli API support.
>>
>> To also route the OSGI Compendium Logging interface then you also need
>> to install 'org.ops4j.pax.logging:pax-logging-service:jar:1.3.0' and a
>> compendium jar I suppose (depending on what this one exports?).
>>
>> > and log4j is really not osgi friendly
>>
>> That may be so but it has a hell of a lot of appenders already
>> provided for you. You can choose to use whatever API you want from
>> above list to interact with Pax-Logging
>>
>> --
>> Cheers,
>>
>> Peter Donald
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: central logging

Posted by LongkerDandy <lo...@gmail.com>.
I just installed pas-logging 1.5.0.
I got this error when starting felix:
Unresolved constraint in bundle org.ops4j.pax.logging.pax-logging-service
[8]: Unable to resolve 8.0: missing requirement [8.0] package;
(&(package=org.apache.avalon.framework.logger)(version>=4.3.0))

so I have to make these api installed, right?

On Wed, Sep 8, 2010 at 1:37 PM, Peter Donald <pe...@realityforge.org> wrote:

> > I know that, it still require a lot of logging bundle installed,
>
> As far as I am aware there only needs to be one bundle installed.
>
> org.ops4j.pax.logging:pax-logging-api:jar:1.3.0 if you want to support
> logging from the following apis:
> * Log4J driving the backend implementation.
> * Log4J API supported.
> * Jakarta Commons Logging API supported.
> * JDK Logging API support.
> * Avalon Logger API support.
> * SLF4J API support.
> * Knopflerfish Log service support.
> * Tomcat Juli API support.
>
> To also route the OSGI Compendium Logging interface then you also need
> to install 'org.ops4j.pax.logging:pax-logging-service:jar:1.3.0' and a
> compendium jar I suppose (depending on what this one exports?).
>
> > and log4j is really not osgi friendly
>
> That may be so but it has a hell of a lot of appenders already
> provided for you. You can choose to use whatever API you want from
> above list to interact with Pax-Logging
>
> --
> Cheers,
>
> Peter Donald
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: central logging

Posted by Peter Donald <pe...@realityforge.org>.
> I know that, it still require a lot of logging bundle installed,

As far as I am aware there only needs to be one bundle installed.

org.ops4j.pax.logging:pax-logging-api:jar:1.3.0 if you want to support
logging from the following apis:
* Log4J driving the backend implementation.
* Log4J API supported.
* Jakarta Commons Logging API supported.
* JDK Logging API support.
* Avalon Logger API support.
* SLF4J API support.
* Knopflerfish Log service support.
* Tomcat Juli API support.

To also route the OSGI Compendium Logging interface then you also need
to install 'org.ops4j.pax.logging:pax-logging-service:jar:1.3.0' and a
compendium jar I suppose (depending on what this one exports?).

> and log4j is really not osgi friendly

That may be so but it has a hell of a lot of appenders already
provided for you. You can choose to use whatever API you want from
above list to interact with Pax-Logging

-- 
Cheers,

Peter Donald

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: central logging

Posted by LongkerDandy <lo...@gmail.com>.
I know that, it still require a lot of logging bundle installed,
and log4j is really not osgi friendly

On Wed, Sep 8, 2010 at 12:50 PM, Peter Donald <pe...@realityforge.org>wrote:

> Pax Logging [1] may be what you want to look at. It routes a lot of
> logging APIs to log4j.
>
> [1] http://wiki.ops4j.org/display/paxlogging/Pax+Logging
>
> On Wed, Sep 8, 2010 at 2:41 PM, LongkerDandy <lo...@gmail.com>
> wrote:
> > Hi
> >
> > I know felix implement the OSGi logging.
> >
> > But there are also some bundles some other logging util like log4j.
> >
> > Is that possible to re-direct the log4j api to OSGi logging, so I get a
> > central view.
> >
> > Regards
> > LongkerDandy
> >
>
>
>
> --
> Cheers,
>
> Peter Donald
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: central logging

Posted by Peter Donald <pe...@realityforge.org>.
Pax Logging [1] may be what you want to look at. It routes a lot of
logging APIs to log4j.

[1] http://wiki.ops4j.org/display/paxlogging/Pax+Logging

On Wed, Sep 8, 2010 at 2:41 PM, LongkerDandy <lo...@gmail.com> wrote:
> Hi
>
> I know felix implement the OSGi logging.
>
> But there are also some bundles some other logging util like log4j.
>
> Is that possible to re-direct the log4j api to OSGi logging, so I get a
> central view.
>
> Regards
> LongkerDandy
>



-- 
Cheers,

Peter Donald

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org