Class LogServiceEnabledLogger
- java.lang.Object
-
- org.apache.felix.http.base.internal.logger.LogServiceEnabledLogger
-
public class LogServiceEnabledLogger extends Object
This abstract class adds support for using a LogService
-
-
Field Summary
Fields Modifier and Type Field Description protected org.osgi.util.tracker.ServiceTracker<Object,Object>
logServiceTracker
protected int
trackingCount
-
Constructor Summary
Constructors Constructor Description LogServiceEnabledLogger(org.osgi.framework.BundleContext bundleContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the loggerboolean
isLogEnabled(int level)
Returnstrue
if logging for the given level is enabled.void
log(int level, String message, Throwable ex)
Method to actually emit the log message.
-
-
-
Method Detail
-
close
public void close()
Close the logger
-
isLogEnabled
public boolean isLogEnabled(int level)
Returnstrue
if logging for the given level is enabled.
-
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 printex
- TheThrowable
causing the message to be logged.
-
-