Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Corona Logging

Revision as of 08:30, 17 August 2006 by Edyta.kalka.compuware.com (Talk | contribs) (Corona Logging Configuration)

OSGi Log Service

Corona Logging uses OSGi Log Service. OSGi specifies two log services:

  • Log Service - allows bundles to log information including a message, a level, an exception, a ServiceReference object, and a Bundle object
  • Log Reader Service - allows bundles to access a list of LogEntry objects, and allows the registration of a LogListener object that receives LogEntry objects as they are created.

To extend control over log statements log4j package is used. It is plugged into Corona through the LogListener object registered with the use of the OSGi Log Reader Service.

For details on OSGi services see: OSGi Service Platform, Service Compendium, Release4, August 2005.

Required Bundles

Bundles/classes/libraries required by Corona Logging:

  • bundle: org.eclipse.corona.logger.log4j
    • class: org.eclipse.corona.logger.log4j.listeners.Log4jListener -> log listener converting OSGi log events to log4j logs
    • class: org.eclipse.corona.logger.log4j.Log4jBundleActivator -> bundle activator responsible for log4j listener initialization and registration within OSGi Log Reader Service
    • log4j.properties -> configuration of log4j loggers, appenders, layouts etc.used by Corona


  • bundle: org.apache.log4j_1.2.13
    • library: log4j-1.2.13.jar -> log4j package
    • class: org.eclipse.corona.logger.log4j.appenders.EclipseLogAppender -> log4j appender responsible for sending logs to eclipse platform (when eclipse application is run/debug, eclipse platform registers a listener responsible for sending logs events to Error Log view), class not required by Corona Logging


  • bundle: org.eclipse.corona.tools
    • class: org.eclipse.corona.log.CoronaLogService -> Log Service wrapper responsible for:
      • retrieval of LogService reference
      • retrieval of DebugOptions service reference - service responsible for loading debug tracking options defined with the use of .options file. For detailed information see: [Eclipse Debug Options chapter]
      • enabling LogService API

CoronaLogService wrapper is to be used by any Corona bundle activator. See: [Sample Bundle Activator using CoronaLogService].

Implementation of OSGi Log Service and Log Reader Service.

Corona Logging Configuration


To assure that OSGi Log Service and Log Reader Service is registered and available:

  • modify config.ini (located inside: ${eclipse_home}/configuration) by adding to osgi.bundles the following: org.eclipse.osgi.services@2:start, org.eclipse.equinox.log@3:start, org.eclipse.corona.logger.log4j@4:start
  • start/restart eclipse workbench.


To define loggers and appenders for Corona:

  • modify log4j.properties located inside org.eclipse.corona.logger.log4j bundle
  • restart org.eclipse.corona.logger.log4j bundle.


To load debug tracking options:

  • start eclipse workbench with the command line argument -debug [.options file path].

If no .options file path is specified, expected location is ${eclipse_home}/.options. Command line argument -debug is equivalent to setting osgi.debug inside config.ini.

To add/remove/modify bundles that are to be run in a debug mode:

  • modify .options file indicated by -debug option
  • start/restart eclipse workbench.

For details on debug tracking options see: [Eclipse Debug Options].

Back to the top