Hi Filippo,

Filippo Diotalevi schrieb:
> Hi,
>  reading this thread on the Spring DM forum [1] reminded me of the
> "logging madness" (commons, log4j, slf4, slf4j bridges, ...) that
> everybody starting with Felix and OSGi (and JaveEE, nowadays) will
> eventually find.
> 
> In brief the problem is the base API of slf4j is a bundle, but
> implementations like lf4j-log4j12 are bundle fragments with
> import/export, therefore currently not supported by Felix.
> These prevents newbies to run, f.i., Spring DM out of the box,
> confusion, and maybe migrating to other osgi containers. Of course
> there are many simple solutions to this problem, but I think it would
> be nice to provide some FAQ/precooked solution for everybody.

Are you sure that this use case is not supported by Framework 1.6.0 ? I
understand that we still have some limitations with fragment support,
but some basic support should be available.
> 
> So the question is: what do you use? What's the best option?
> 
> - in my case, I have osgi-fied slf4 with the log4j binding with the
> maven osgi plugin.   Maybe a candidate for felix commons?
> 
> - does such a bundle already exist anywhere, so we can point user to
> that bundle?

We saved our day in Sling by creating our own logging bundle. We had the
requirement to support the SLF4J, Log4J and JCL APIs as well as have a
LogService implementation. Initiallly we were based on LogBack but
switched to a home-grown, very simple SLF4J SPI implementation in the
meantime, because this lets us configured the backend more easily.

You might also want to lock at what exists in PAX Logging, on which the
Felix log bundle is based IIRC.

Regards
Felix


> 
> - I actually noticed that if I remove the Fragment-Host property in
> the lf4j-log4j12.jar everything seems to work. Such property was added
> to make it work with Equinox (bug 73 [2]) due to a dependency cycle
> between the api and the impl.
> However, removing the fragmeng-host, Felix doesn't complain
> 
> 
> [1] http://forum.springsource.org/showthread.php?t=70639
> [2] http://bugzilla.slf4j.org/show_bug.cgi?id=73

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to