Here is my configuration:
We are developing an OSGi application and want to enable logging. I decided to use slf4j + logback.
We use Eclipse as an IDE and Tycho to use the Eclipse IDE, such as Manifest Editor, etc.
So, I tried the following:
A new plugin has been created with the following Manifest.mf:
Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Createcommand Bundle-SymbolicName: de.hswt.oms.ws.wsr.createcommand Bundle-Version: 1.0.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Import-Package: de.hswt.oms.ws.command.wsr, de.hswt.oms.ws.ds.core.data.impl, org.slf4j Service-Component: OSGI-INF/component.xml
Now, when I go to Run -> Run Configurations -> OSGi Framework and select my Bundle and click "Add necessary plugins", more than 100 packs will be selected, and I get a lot of errors and exceptions.
So, I came up with a new plugin from existing Jars, which includes the following three banks:
- Logback-classic-1.0.7
- Logback-core-1.0.7
- com.springsource.slf4j.api-1.6.1 (I don't believe this is a good idea, but hey ...)
If I create a new launch configuration manually (without clicking "add the necessary packages", it works as expected, but as far as I click "add the necessary packages", I return to more than 100 links with a lot of errors (some Jetty, for example. ..)
So my question is: how to enable logback and slf4j in my OSGi application and use it in eclipse and configure it correctly?
If you need more information, feel free to ask.
hueck
source share