Benson, I think you will have serious problems getting this to work, for reasons that you mention.
I think that you could make this work if you, a. Create your own Pax Logging Service implementation bundle. SLF4J is not part of the Pax Logging API, so that conflict is not inherently there. b. Figure out how to bind that bundle to SLF4J on the outside. I have not read up on OSGi classloading tricks since 4.1, so I don't know if it is now possible to instruct a single bundle to go to system classloader somehow, instead of importing from framework. I *might* be easier to proved a logger factory provider (can't recall the exact term) in the outside SLF4J world and that factory is tied into the Pax Logging API on the inside. IF that is an option, my guess is that it is easier to make working. But I am also aware that such tricks may be out of scope... HTH Niclas On Wed, Nov 2, 2016 at 3:15 AM, Benson Margulies <[email protected]> wrote: > I think I'm asking the wrong question here. I'll post a more relevant one. > > On Tue, Nov 1, 2016 at 1:52 PM, Benson Margulies <[email protected]> > wrote: > > I think I want to do the following: I want to embed an OSGi container > > in an application that logs with logback, I want to list logback as a > > system bundle package, and have pax-logging route the output to the > > 'outside' by using the logback thus exported. > > > > This seems intrinsically a bit tricky, since the API to logback is > > generally just slf4j. > > > > However, the fact that pax-logging-logback embeds the logback code, > > and then does not have Import-Package instructions to allow that embed > > to be overriden, also seems potentially problematic. > > > > In the code in its current form, can I do this? I could just try > > system-bundling slf4j itself and see if pax-logging-logback ends up > > doing what I want; I thought I'd ask in case someone had some prior > > experience to share. > > -- > -- > ------------------ > 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. > -- 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.
