Package org.apache.felix.configurator.impl.logger

## Class LogServiceEnabledLogger

- java.lang.Object
- - org.apache.felix.configurator.impl.logger.LogServiceEnabledLogger

    public class LogServiceEnabledLogger
    extends Object

This class adds support for using a LogService

### Field Summary

Fields
`protected org.osgi.util.tracker.ServiceTracker<Object,​Object>` `logServiceTracker`
`protected int` `trackingCount`

### Constructor Summary

Constructors
`LogServiceEnabledLogger​(org.osgi.framework.BundleContext bundleContext)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()` Close the logger
`void` `log​(int level, String message, Throwable ex)` Method to actually emit the log message.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### logServiceTracker

    protected final org.osgi.util.tracker.ServiceTracker<Object,​Object> logServiceTracker

#### trackingCount

    protected volatile int trackingCount

### Constructor Detail

#### LogServiceEnabledLogger

    public LogServiceEnabledLogger​(org.osgi.framework.BundleContext bundleContext)

### Method Detail

#### close

    public void close()

Close the logger

#### log

    public void log​(int level,
                    String message,
                    Throwable ex)

Method to actually emit the log message. If the LogService is available, the message will be logged through the LogService. Otherwise the message is logged to stdout (or stderr in case of LOG_ERROR level messages),

Parameters:
  `level` - The log level of the messages. This corresponds to the log levels defined by the OSGi LogService.
  `message` - The message to print
  `ex` - The `Throwable` causing the message to be logged.