Use org.rifidi.logging

From RifidiWiki

Jump to: navigation, search

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 to provide configuration information. The plugin itself does not have a folder in it. Instead, it relies on a OSGi bundle fragment to add one to the classpath.

To use it in another plugin:

  1. 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 from org.rifidi.binary along with a target platform.
  2. 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.
  3. In the run configuration:
    1. Make sure that org.rifidi.logging is checked.
    2. 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.
    3. Make sure that org.apache.commons.logging or org.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.

Note: Once a Rifidi application is exported teh Edge logging configuration is set in \server\config\

Default Configuration (Info and higher (no debug output)

#Default level is INFO to avoid too much output from 3rd Party libraries
log4j.rootLogger=INFO, stdout, fileappender

#Don't care about springframework info statements
#Except for RMI info statements!

#output from apache projects

#Output from LLRP LTK

#Output from Rifidi Edge Server core

#Set up Console appender
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c:%L - %m%n

#Set up File Appender
#log4j.appender.fileappender.layout.ConversionPattern=%d{ABSOLUTE} %5p %c:%L - %m%n
Personal tools