Package org.osgi.service.log
Interface LogEntry
-
public interface LogEntryProvides methods to access the information contained in an individual Log Service log entry.A
LogEntryobject may be acquired from theLogReaderService.getLogmethod or by registering aLogListenerobject.- Version:
- $Revision: 5654 $
- See Also:
LogReaderService.getLog(),LogListener
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.osgi.framework.BundlegetBundle()Returns the bundle that created thisLogEntryobject.java.lang.ThrowablegetException()Returns the exception object associated with thisLogEntryobject.intgetLevel()Returns the severity level of thisLogEntryobject.java.lang.StringgetMessage()Returns the human readable message associated with thisLogEntryobject.org.osgi.framework.ServiceReferencegetServiceReference()Returns theServiceReferenceobject for the service associated with thisLogEntryobject.longgetTime()Returns the value ofcurrentTimeMillis()at the time thisLogEntryobject was created.
-
-
-
Method Detail
-
getBundle
org.osgi.framework.Bundle getBundle()
Returns the bundle that created thisLogEntryobject.- Returns:
- The bundle that created this
LogEntryobject;nullif no bundle is associated with thisLogEntryobject.
-
getServiceReference
org.osgi.framework.ServiceReference getServiceReference()
Returns theServiceReferenceobject for the service associated with thisLogEntryobject.- Returns:
ServiceReferenceobject for the service associated with thisLogEntryobject;nullif noServiceReferenceobject was provided.
-
getLevel
int getLevel()
Returns the severity level of thisLogEntryobject.This is one of the severity levels defined by the
LogServiceinterface.- Returns:
- Severity level of this
LogEntryobject. - See Also:
LogService.LOG_ERROR,LogService.LOG_WARNING,LogService.LOG_INFO,LogService.LOG_DEBUG
-
getMessage
java.lang.String getMessage()
Returns the human readable message associated with thisLogEntryobject.- Returns:
Stringcontaining the message associated with thisLogEntryobject.
-
getException
java.lang.Throwable getException()
Returns the exception object associated with thisLogEntryobject.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:
Throwableobject of the exception associated with thisLogEntry;nullif no exception is associated with thisLogEntryobject.
-
getTime
long getTime()
Returns the value ofcurrentTimeMillis()at the time thisLogEntryobject was created.- Returns:
- The system time in milliseconds when this
LogEntryobject was created. - See Also:
- "System.currentTimeMillis()"
-
-