Wiki
Clone wikiSLF4J bridges for Eclipse and OSGi / Home
SLF4J bridge for Eclipse Log and OSGi Log service
A tiny project which only purpose is to bridge legacy Eclipse log and OSGi log service events and redirect this calls to SLF4J instead. Project automatically forces all other plug-ins (bundles) to log throught SLF4J, no setting is required.
About
Project consists of two utility classes,
org.virtage.SLF4JforEclipse
for Eclipse log org.eclipse.core.runtime.ILog.org.virtage.SLF4JforOSGi
for OSGi Log Service. For Equinox OSGi framework, extended logging capability is supported.
Actually speaking, classes doesn't redirect to SLF4J but repeat legacy logging API calls to SLF4J API calls. It's up to user whether he or she will deactivate legacy logging to console or file to don't duplicate logging.
Usage
Classes doesn't require any configuration. They automatically observe all available plug-ins (bundles) and attach itself as a listener for their log events. Listeners are manager internally by API, and at client side usage is as simple as
SLF4JforEclipse.register(BundleContext)
for Eclipse Platform's org.eclipse.core.runtime.ILog]. Or for OSGi environment with
SLF4JforOSGi.register(BundleContext)
At all cases, register()
method will lookup active plug-ins (bundles) from supplied BundleContext
and start to listen for their log events.
Questions?
If you got any question or have found a bug, report it as issue.
You are also welcomed to fork project if you feel you can improve it a bit (or a big).
Licence
This piece of code is public domain.
To the extent possible under law, Libor Jelinek (author) has waived all copyright and related or neighboring rights to "SLF4J bridge for Eclipse Log and OSGi Log Service" (artwork). This work is published from Czech Republic.
You can do whatever you want. There are no restrictions, no needs to keep licence or list author. But also no warranty, implied nor explicit.
Updated