Ok, standard question (should put up an FAQ for it).

Log4j suffers from lack of separation of API from SPI from
implementation. Once you start pulling in that mess, you will quickly
pull "everything" with you, and the entire Log4j codebase will fall
into your lap. That is not what Pax Logging needs to do. It needs to
create a clean cut between an API and an implementation, and then have
some mechanism to make all other APIs use the same mechanism.

So, to make Log4j work in Pax Logging API(!) at all, I need to make
judgment calls of what is an API and what is various forms of
implementation or SPI. In reality it isn't that hard; Basically all
the commonality of the many APIs dictates what really is a logging
API. Appenders don't fall into that category, it is an SPI, like
Formatters and many other details. You should still be able to add
appenders to Log4j's backend, either via
org.ops4j.pax.logging.appender SPI or simply a Fragment with your
appender and attach it to the Pax Logging Service bundle as the host,
provided it can be instantiated via Log4j properties configuration
system.

The Log4j backed implementation of Pax Logging Service is not
exporting any Log4j classes at all, since they are highly private to
the bundle. And IIRC, it doesn't import any either, since that would
mess up the usage with the packages exported by Pax Logging API, which
are modified to fit the environment they are executing in.
Also, it is ok to create additional Pax Logging Service
implementations, for instance using Logback (LGPL now), without
touching the classes in Pax Logging API.

If you really dig, you will be able to find many changes to the
various codebases, making Pax Logging not behave exactly like the
original. That has been a necessary trade-off, and any request to
change this is handled case-by-case.

Hope that helps as an explanation.

On Mon, Jan 17, 2011 at 7:13 PM, Willem Jiang <[email protected]> wrote:
> Hi,
>
> Pax-logging is using log4j underlay, but pax-logging-api bundle doesn't has
> the Appender in its exported package "org.apache.log4j",
> the pax-logging-service bundle has the Appender class but it doesn't export
> "org.apache.log4j" package.
>
> According to the Pax-logging wiki, "Pax-logging supports Log4J API".
> So my question is why Pax-logging doesn't expose the log4j Appender class?
>
>
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>         http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
>
> _______________________________________________
> general mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/general
>



-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I live here; http://tinyurl.com/3xugrbk
I work here; http://tinyurl.com/24svnvk
I relax here; http://tinyurl.com/2cgsug

_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to