I should encourage you to stop. In essence, log4j v1.x is not well-defined when it comes to API/impl separation or modularization in general. I made an attempt to have a pax-logging-spi, which purpose was to allow custom components, Appenders primarily, to be runtime deployable and used by Log4j, but I don't think it ever came to working.
The export list of Log4j is simply BND by default exporting all packages that are not named .internal or .impl. People in Log4j never had any OSGi interest and have not spent many minutes on the topic. And IF you let the log4j bundle be used directly, then you strongly tie the user's of Logger to Log4j in runtime, and replacement can't happen without stopping all bundles. Niclas On Tue, Apr 23, 2019 at 8:43 PM Grzegorz Grzybek <[email protected]> wrote: > Hello > > I reviewed what's included (possibly after changing) from original > log4j:log4j (and log4j:apache-log4j-extras) in: > – pax-logging-api > – pax-logging-service > > The investigation result is interesting... > – most changed files are in org.apache.log4j package itself, which is > obvious, but for example, org.apache.log4j.Category class is both in > pax-logging-api and pax-logging-service > – some source files are copied from log4j to pax-logging-service without > changes (which is strange, because even the ones that are not copied at > source code level are eventually in pax-logging-service jar because of > `org.apache.log4j` Private-Package and maven dependency on log4j:log4j) > – original log4j:log4j:1.2.17 is actually proper OSGi bundle, but has > different set of exports (i.e., public API) > > I checked what's exported from log4j:log4j (and log4j:apache-log4j-extras) > and: > > pax-logging-service doesn't export anything, which is fine - we only miss > some real integration tests that show how to extend log4j (layouts, > appenders, patterns, filters) using fragment jars > > pax-logging-api exports only: > – org.apache.log4j > – org.apache.log4j.spi > – org.apache.log4j.xml > > but log4j itself exports additionally: > – org.apache.log4j.config > – org.apache.log4j.helpers > – org.apache.log4j.jdbc > – org.apache.log4j.jmx > – org.apache.log4j.net > – org.apache.log4j.nt > – org.apache.log4j.or > – org.apache.log4j.or.jms > – org.apache.log4j.or.sax > – org.apache.log4j.pattern > – org.apache.log4j.rewrite > – org.apache.log4j.varia > > Even if we should stick to the 3 ones, some classes from spi use > (uses:="...") other packages which are not exported. > > Let me continue reviewing and separating properly API and Impl or tell me > to stop ;) > > regards > Grzegorz Grzybek > > -- > -- > ------------------ > 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://polygene.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.
