Difference between revisions of "Use org.rifidi.logging"
From RifidiWiki
Line 1: | Line 1: | ||
− | + | <code>org.rifidi.logging</code> is a bundle that provides a logging service for other bundles in the rifidi project. Specifically it provides <code>org.apache.commons.logging</code> and <code>org.apache.log4j</code>. Log4J relies on a file called <code>log4j.properties</code> to provide configuration information. The plugin itself does not have a <code>log4j.properties</code> folder in it. Instead, it relies on a OSGi bundle fragment to add one to the classpath. | |
− | + | ||
To use it in another plugin: | To use it in another plugin: | ||
− | # Make sure that the bundle is checked out in your workspace. You can either download the plugin from the | + | # Make sure that the bundle is checked out in your workspace. You can either download the plugin from the <code>rep-external</code> svn repository, or you can use the binary from <code>org.rifidi.binary</code> along with a target platform. |
− | # In the Manifest for your plugin, declare a package import of | + | # In the Manifest for your plugin, declare a package import of <code>org.apache.commons.logging</code>. Make sure that the minimum version is 1.0.4. |
# In the run configuration: | # In the run configuration: | ||
− | ## Make sure that | + | ## Make sure that <code>org.rifidi.logging</code> is checked. |
## Make sure that only one log4J fragment is checked. If more than one is loaded, it is not defined which one will be used to configure log4j. | ## Make sure that only one log4J fragment is checked. If more than one is loaded, it is not defined which one will be used to configure log4j. | ||
− | ## Make sure that | + | ## Make sure that <code>org.apache.commons.logging</code> or <code>org.apache.log4j</code> is not being provided by a target platform. It is recommended that target platforms used by rifidi not contain either of these two bundles. |
Revision as of 19:41, 26 November 2010
org.rifidi.logging
is a bundle that provides a logging service for other bundles in the rifidi project. Specifically it provides org.apache.commons.logging
and org.apache.log4j
. Log4J relies on a file called log4j.properties
to provide configuration information. The plugin itself does not have a log4j.properties
folder in it. Instead, it relies on a OSGi bundle fragment to add one to the classpath.
To use it in another plugin:
- Make sure that the bundle is checked out in your workspace. You can either download the plugin from the
rep-external
svn repository, or you can use the binary fromorg.rifidi.binary
along with a target platform. - In the Manifest for your plugin, declare a package import of
org.apache.commons.logging
. Make sure that the minimum version is 1.0.4. - In the run configuration:
- Make sure that
org.rifidi.logging
is checked. - Make sure that only one log4J fragment is checked. If more than one is loaded, it is not defined which one will be used to configure log4j.
- Make sure that
org.apache.commons.logging
ororg.apache.log4j
is not being provided by a target platform. It is recommended that target platforms used by rifidi not contain either of these two bundles.
- Make sure that