Package org.osgi.service.log
Interface LogEntry
public interface LogEntry
Provides methods to access the information contained in an individual Log
Service log entry.
A LogEntry
object may be acquired from the
LogReaderService.getLog
method or by registering a
LogListener
object.
- Version:
- $Revision: 5654 $
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionorg.osgi.framework.Bundle
Returns the bundle that created thisLogEntry
object.Returns the exception object associated with thisLogEntry
object.int
getLevel()
Returns the severity level of thisLogEntry
object.Returns the human readable message associated with thisLogEntry
object.org.osgi.framework.ServiceReference
Returns theServiceReference
object for the service associated with thisLogEntry
object.long
getTime()
Returns the value ofcurrentTimeMillis()
at the time thisLogEntry
object was created.
-
Method Details
-
getBundle
org.osgi.framework.Bundle getBundle()Returns the bundle that created thisLogEntry
object.- Returns:
- The bundle that created this
LogEntry
object;null
if no bundle is associated with thisLogEntry
object.
-
getServiceReference
org.osgi.framework.ServiceReference getServiceReference()Returns theServiceReference
object for the service associated with thisLogEntry
object.- Returns:
ServiceReference
object for the service associated with thisLogEntry
object;null
if noServiceReference
object was provided.
-
getLevel
int getLevel()Returns the severity level of thisLogEntry
object.This is one of the severity levels defined by the
LogService
interface.- Returns:
- Severity level of this
LogEntry
object. - See Also:
-
getMessage
String getMessage()Returns the human readable message associated with thisLogEntry
object.- Returns:
String
containing the message associated with thisLogEntry
object.
-
getException
Throwable getException()Returns the exception object associated with thisLogEntry
object.In some implementations, the returned exception may not be the original exception. To avoid references to a bundle defined exception class, thus preventing an uninstalled bundle from being garbage collected, the Log Service may return an exception object of an implementation defined Throwable subclass. The returned object will attempt to provide as much information as possible from the original exception object such as the message and stack trace.
- Returns:
Throwable
object of the exception associated with thisLogEntry
;null
if no exception is associated with thisLogEntry
object.
-
getTime
long getTime()Returns the value ofcurrentTimeMillis()
at the time thisLogEntry
object was created.- Returns:
- The system time in milliseconds when this
LogEntry
object was created. - See Also:
-