On 11/13/06, Pierre Parrend <[EMAIL PROTECTED]> wrote:

This makes me understand better how the pax logger works. I still have a
question: what is the role of the pax own logging api, does it bring something
that the other logger do not have ?

Actually, I am looking for the following:
- I already have some osgi bundles that use log4j
- I would like to define a central logging configuration for all my bundles
- I do not want to re invent the wheel

so pax seems to be quite adapted to my needs, but seems to lack on feature :
- provide a org.apache.log4j.Logger instance as a service, that could be
accessed from all other bundles. Such a service would be easy to configure with
its own properties.

however, it does not seem that the log4j Logger is currently available as a
service on pax. Does it helps if I write the code for this ? Would it be
possible to integrate it in Pax ? (I do not claim it is difficult, but from my
view I could be usefull ;-))

Not sure what you have mind.
If you load the API, the Service and the Log4J API bundles, then any

   Logger logger = Logger.getLogger( Abc.class );

will work in all other bundles that imports org.apache.log4j package.

It should require zero code changes and only a matter of getting the import package statements right.

The configuration for ALL bundles are sent to the Pax Logging Service, and managed as with any Log4J application. If you insist on using XML config, then you must do the indirect way via setting a pointer to the file. If the Properties format is ok, then you can provide the Log4J configuration straight in the OSGi Configuration itself.

Cheers
Niclas


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

Reply via email to