Skip to main content
Jump to: navigation, search

Wazaabi/Logging

Wazaabi uses SLF4J and logback as logging system.

Installation

Currently, you need to install SLF4J from Orbit repository, following plugins are needed:

  • SLF4J API
  • Logback Core Module
  • Logback Classic Module
  • Logback Native SLF4J Logger Module

The build has to be updated to include everything in Wazaabi update site.

Creating log records

Add import-package to MANIFEST.MF:

Import-Package: org.slf4j

In your classes:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
 
class MyClass {
    private final static Logger logger = LoggerFactory.getLogger(MyClass.class);
 
    void doSomething(int p) {
        logger.debug("Doing something with {}", p);
    }
}


Configuration

By default, SLF4J will log into System.out. In order to change the destination or to tweek messages, you can create a config file, that has to be

  • either on classpath of logging implementation (i.e. create a fragment to native logback)
  • or set JVM system property with config file path:
-Dlogback.configurationFile=<path-to-logback.xml>

Viewing logs

There's a nice Eclipse plug-in to view logs: Beagle

Back to the top