public class PaxLoggingServiceImpl extends Object implements PaxLoggingService, LogService, org.osgi.service.cm.ManagedService, org.osgi.framework.ServiceFactory
APPENDER_NAME_PROPERTY
LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING
Constructor and Description |
---|
PaxLoggingServiceImpl(org.osgi.framework.BundleContext context,
LogReaderServiceImpl logReader,
EventAdminPoster eventAdmin) |
Modifier and Type | Method and Description |
---|---|
PaxLogger |
getLogger(org.osgi.framework.Bundle bundle,
String category,
String fqcn) |
int |
getLogLevel()
* Get the current log level.
|
PaxContext |
getPaxContext() |
Object |
getService(org.osgi.framework.Bundle bundle,
org.osgi.framework.ServiceRegistration registration) |
void |
log(int level,
String message)
Logs a message.
|
void |
log(int level,
String message,
Throwable exception)
Logs a message with an exception.
|
void |
log(org.osgi.framework.ServiceReference sr,
int level,
String message)
Logs a message associated with a specific
ServiceReference
object. |
void |
log(org.osgi.framework.ServiceReference sr,
int level,
String message,
Throwable exception)
Logs a message with an exception associated and a
ServiceReference object. |
protected void |
shutdown()
Shut down the Pax Logging service.
|
void |
ungetService(org.osgi.framework.Bundle bundle,
org.osgi.framework.ServiceRegistration registration,
Object service) |
void |
updated(Dictionary configuration) |
public PaxLoggingServiceImpl(org.osgi.framework.BundleContext context, LogReaderServiceImpl logReader, EventAdminPoster eventAdmin)
protected void shutdown()
public PaxLogger getLogger(org.osgi.framework.Bundle bundle, String category, String fqcn)
getLogger
in interface PaxLoggingService
public int getLogLevel()
LogService
getLogLevel
in interface PaxLoggingService
public void log(int level, String message)
LogService
The ServiceReference
field and the Throwable
field
of the LogEntry
object will be set to null
.
log
in interface LogService
level
- The severity of the message. This should be one of the
defined log levels but may be any integer that is interpreted in a
user defined way.message
- Human readable string describing the condition or
null
.LogService.LOG_ERROR
,
LogService.LOG_WARNING
,
LogService.LOG_INFO
,
LogService.LOG_DEBUG
public void log(int level, String message, Throwable exception)
LogService
The ServiceReference
field of the LogEntry
object
will be set to null
.
log
in interface LogService
level
- The severity of the message. This should be one of the
defined log levels but may be any integer that is interpreted in a
user defined way.message
- The human readable string describing the condition or
null
.exception
- The exception that reflects the condition or
null
.LogService.LOG_ERROR
,
LogService.LOG_WARNING
,
LogService.LOG_INFO
,
LogService.LOG_DEBUG
public void log(org.osgi.framework.ServiceReference sr, int level, String message)
LogService
ServiceReference
object.
The Throwable
field of the LogEntry
will be set to
null
.
log
in interface LogService
sr
- The ServiceReference
object of the service that this
message is associated with or null
.level
- The severity of the message. This should be one of the
defined log levels but may be any integer that is interpreted in a
user defined way.message
- Human readable string describing the condition or
null
.LogService.LOG_ERROR
,
LogService.LOG_WARNING
,
LogService.LOG_INFO
,
LogService.LOG_DEBUG
public void log(org.osgi.framework.ServiceReference sr, int level, String message, Throwable exception)
LogService
ServiceReference
object.log
in interface LogService
sr
- The ServiceReference
object of the service that this
message is associated with.level
- The severity of the message. This should be one of the
defined log levels but may be any integer that is interpreted in a
user defined way.message
- Human readable string describing the condition or
null
.exception
- The exception that reflects the condition or
null
.LogService.LOG_ERROR
,
LogService.LOG_WARNING
,
LogService.LOG_INFO
,
LogService.LOG_DEBUG
public void updated(Dictionary configuration) throws org.osgi.service.cm.ConfigurationException
updated
in interface org.osgi.service.cm.ManagedService
org.osgi.service.cm.ConfigurationException
public Object getService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration)
getService
in interface org.osgi.framework.ServiceFactory
public void ungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration, Object service)
ungetService
in interface org.osgi.framework.ServiceFactory
public PaxContext getPaxContext()
getPaxContext
in interface PaxLoggingService
Copyright © 2019. All rights reserved.