Here is my configuration:
We are developing an OSGi application and want to include logging. I decided to use slf4j + logback.
We are using Eclipse as an IDE and Tycho to benefit from the Eclipse IDE like Manifest Editor and so on.
So I have tried the following:
Created a new plugin 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 move to Run -> Run Configurations -> OSGi Framework and select my Bundle and click "Add Required plugins" more than 100 Bundles will be selected and I get a lot of errors and exceptions.
So I came up with a new plugin from existing Jars which include the following three jars:
- logback-classic-1.0.7
- logback-core-1.0.7
- com.springsource.slf4j.api-1.6.1 (I dont believe this is a good idea, but hey...)
If I create a new run configuration manually (not clicking "add required bundles" it works as expected but as far as I click "add required bundles" I come back to the more then 100 Bundles with a lot of errors (some Jetty stuff for example...)
So my Question is: How can I enable logback and slf4j in my OSGi application and use it within eclipse and configure it properly?
If you need more information please feel free to ask.