Kismet,

I have many times tried to explain the rationale behind the Pax Logging
architecture, and I think it is time to put them up on the first paragraph
of the docs.

Very well,
Log4j is 4 things, an API, SPI, Configuration and an implementation. And the
real problem is that Ceki (sorry to give you blame) and other Log4j
developers wasn't receptable to understand this distinction and just treated
all as a single take-it-or-leave package.

So, when Pax Logging came about, I decided that I want to support as many
other APIs as possible and have Log4j under the hood, potentially be able to
swap it out later if I saw a need. Unfortunately, *I* was too lazy and used
the log4j Configuration as well, which is a public, and therefor I can't
change the service implementation easily.

Secondly, I tried to isolate the API in log4j, and make that available. But
since the lack of separation, there are no clear boundary. I'm pretty sure
you can find clients using every class in log4j.jar. A judgment was made.
Layout, Formatters, Appenders and similar was considered outside the API.
Not a lot of code uses these classes.

How to get around it? Well in true OSGi spirit, it should be a matter of you
creating a bundle of stubs of the classes satisfying the client. Exactly
what those mocks need to do, depends on the client code.
If it requires that the layout makes it to the log4j configuration, then you
might be short on luck, as there is currently no programmatic interface to
the configuration. But that is something we could look into, if needed...

Cheers
Niclas

On Jul 17, 2009 10:59 PM, "Stefano "Kismet" Lenzi" <[email protected]>
wrote:

Hi All,

I have project namely jain-sip that uses Log4J for logging, I tryed to
execute the library inside OSGi by means of pax-logging and I got the
error:
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Layout
       at gov.nist.javax.sip.SipStackImpl.<init>(SipStackImpl.java:398)
I found out that neither pax-logging-api version 1.3.0 nor
1.4.0-SNAPSHOT provides the org.apache.log4j.Layout classes. So my
questions are:
 - How can I provide to the OSGi Enviroment the
org.apache.log4j.Layout without breaking the pax-logging-api wiring?
 - Why haven't you included such class in pax-logging-api bundle?

Thank you!

Ciao,
Stefano "Kismet" Lenzi

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

Reply via email to