-
Notifications
You must be signed in to change notification settings - Fork 27
Logging
The EarthSci
platform provides an au.gov.ga.earthsci.logging
plugin that configures SLF4J and overrides the default provided logging mechanisms.
This plugin replaces:
- The default Eclipse
org.eclipse.e4.core.services.log.Logger
implementation, - The default Eclipse
org.eclipse.e4.core.services.log.ILoggerProvider
factory, - The default OSGi
org.osgi.service.log.LogService
implementation, and - Any existing
java.util.logging.*
configuration
The plugin bridges these disparate logging mechanisms into a single SLF4J layer backed by the LogBack implementation.
As a developer, you are still able to use any of these logging mechanisms in your code as appropriate. However, if you are writing components that exist outside of the e4 dependency injection mechanism, or are not OSGi bundle specific, we recommend you use the industry standard SLF4J 'classic' logging approach.
This is the recommended approach to use for any code that is:
- Outside the Eclipse dependency injection mechanism, or
- Not specific to the lifecycle of an OSGi bundle, or
- Needed within classes that are instantiated outside a bundle or Eclipse context
...
private static final Logger logger = LoggerFactory.getLogger(MyClass.class);
...
Currently logging is provided by the LogBack framework. This is a highly flexible framework that offers configuration via XML.
The default configuration is provided by the au.gov.ga.earthsci.logging
plugin. To change this behavior, simply place a logback.xml
file into the workspace.
For more information on LogBack configuration, see the project documentation.
- SLF4J - http://www.slf4j.org/
- LogBack - http://logback.qos.ch/
- e4 platform services - http://www.vogella.com/articles/Eclipse4Services/article.html
- OSGi log service - http://www.osgi.org/javadoc/r4v42/org/osgi/service/log/LogService.html