I am not sure whether exposing the classes will work as expected, as
classloader may throw you for a spin. However, it is an easy way to test;
  1. expose the container to SLF4J
  2. don't load the SLF4J API in Pax Logging (are they still separated?
otherwise a new build might be needed for you)
  3. write a service that bridge the non-SLF4J events to SLF4J.

IF that doesn't work, you need to inject the bundle instance from the
outside.

Cheers
Niclas

On Sat, Aug 13, 2016 at 2:06 AM, <[email protected]> wrote:

> On 2016-08-12T17:08:37 +0800
> Niclas Hedhman <[email protected]> wrote:
>
> > It is doable, but you will need to implement a new service bundle for Pax
> > Logging.
> >
> > The tricky bit is that on one hand, you need Pax Logging's SLF4J classes
> to
> > be used internally in the OSGi container, yet you need to "reach" those
> > classes on the outside.
> >
> > What you should do is a bundle that implements the Pax Logging service,
> and
> > pass it from the containing application when Felix is booted. That gives
> > you enough bridge to be on both sides of the container barrier, without
> too
> > much classloader issues.
> >
> > I don't recall the details for how Felix accepts bundles from the
> outside,
> > but I have done it in the past. Since Pax Logging doesn't introduce a
> > classloader dependency from its API to its service bundle, this should
> work
> > without classloading issues.
> >
> > I normally don't watch this list too often, so CC me if you have further
> > questions once you are on the way.
>
> 'Lo.
>
> That doesn't seem so bad. Doing it in a way that will work across
> different container implementations might be a problem. I think the
> org.osgi.framework.system.packages.extra property might be all it takes
> to expose the bundle from the host.
>
> M
>



-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to