Class LogServiceEnabledLogger
java.lang.Object
org.apache.felix.configurator.impl.logger.LogServiceEnabledLogger
public class LogServiceEnabledLogger
extends java.lang.Object
This class adds support for using a LogService
-
Field Summary
Fields Modifier and Type Field Description protected org.osgi.util.tracker.ServiceTracker<java.lang.Object,java.lang.Object>logServiceTrackerprotected inttrackingCount -
Constructor Summary
Constructors Constructor Description LogServiceEnabledLogger(org.osgi.framework.BundleContext bundleContext) -
Method Summary
-
Field Details
-
logServiceTracker
protected final org.osgi.util.tracker.ServiceTracker<java.lang.Object,java.lang.Object> logServiceTracker -
trackingCount
protected volatile int trackingCount
-
-
Constructor Details
-
LogServiceEnabledLogger
public LogServiceEnabledLogger(org.osgi.framework.BundleContext bundleContext)
-
-
Method Details
-
close
public void close()Close the logger -
log
public void log(int level, java.lang.String message, java.lang.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 printex- TheThrowablecausing the message to be logged.
-