[slf4j-user] switching logging to LOGBACK [OSGI]

ekke ekkehard at gentz-software.de
Tue Sep 16 16:16:13 CEST 2008


I'm just in the decision to switch logging from log4j to LOGBACK + slf4j

my current OSGI installation:

bundle com.springsource.org.apache.log4j
-- exporting all log4j packages

bundle myLog4jproperties
-- fragment-Host: com.springsource.org.apache.log4j 
-- containing my log4j.-xml as configfile at root of sourcefolder 

this works well

-------
now I'm using following bundles:

bundle com.springsource.ch.qos.logback.core
-- exporting logback.core packages

bundle com.springsource.ch.qos.logback.classic
-- importing logback.core
-- exporting logback.classic packages
-- exporting org-slf4j.impl

bundle com.springsource.slf4j.api
-- importing org-slf4j.impl
-- exporting org.slf4j, org.slf4j.helpers, org.slf4j.spi

bundle com.springsource.slf4j.org.apache.commons.logging
-- importing org.slf4j, org.slf4j.spi
-- exporting org.apache.commons.logging + impl

this works well:
* in my own bundles I can log directly to logback
* 3rdparty bundles using JCL now are logging over slf4j

I also have 3rdparty bundles using log4j, so I tried:
bundle com.springsource.slf4j.org.apache.log4j
-- importing org.slf4j, org.slf4j.spi
-- exporting org.apache.log4j
this fails :-(
the 3rdPartyBundle is using log4j.xml, but this packages wasn't provided
from the bridge log4j over slf4j
so I still have to use log4j together with slf4j / logback. this works well

:::: my questions:::::::::::
* can I automatically convert my log4j.xml configfile into logback.xml ?
* where to place the logback.xml ? I think, a fragment of logback.classic
with logback.xml at root of sourcefolder would be good, or would you
recommend logback.core ?
* when using JCL over slf4j (logback) - am I right that then all
configuration would be only into logback.xml ?
(* and if perhaps using log4j over slf4j too, then also all config is in
logback.xml ?)

ekke
excuse the posting in logback and slf4j list, I'm new here and dont know who
is responsible
after finishing my switch I'll blog about it, so other OSGI equinox
developers can see how to make it run


-- 
View this message in context: http://www.nabble.com/switching-logging-to-LOGBACK--OSGI--tp19512795p19512795.html
Sent from the Slf4J - user mailing list archive at Nabble.com.




More information about the slf4j-user mailing list