Interface LogEntry
-
@ProviderType 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated 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()Deprecated.Since 1.4.java.lang.StackTraceElementgetLocation()Returns the location information of the creation of thisLogEntryobject.java.lang.StringgetLoggerName()Returns the name of theLoggerobject used to create thisLogEntryobject.LogLevelgetLogLevel()Returns the level of thisLogEntryobject.java.lang.StringgetMessage()Returns the formatted message associated with thisLogEntryobject.longgetSequence()Returns the sequence number for thisLogEntryobject.org.osgi.framework.ServiceReference<?>getServiceReference()Returns theServiceReferenceobject for the service associated with thisLogEntryobject.java.lang.StringgetThreadInfo()Returns a string representing the thread which created 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
@Deprecated int getLevel()
Deprecated.Since 1.4. Replaced bygetLogLevel().Returns the integer level of thisLogEntryobject.If one of the
logmethods ofLogServicewas used, this is the specified integer level. Otherwise, this is theordinalvalue of thelog level.- Returns:
- Integer level of this
LogEntryobject.
-
getMessage
java.lang.String getMessage()
Returns the formatted message associated with thisLogEntryobject.- Returns:
Stringcontaining the formatted 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()"
-
getLogLevel
LogLevel getLogLevel()
Returns the level of thisLogEntryobject.- Returns:
- The level of this
LogEntryobject. - Since:
- 1.4
-
getLoggerName
java.lang.String getLoggerName()
Returns the name of theLoggerobject used to create thisLogEntryobject.- Returns:
- The name of the
Loggerobject used to create thisLogEntryobject. - Since:
- 1.4
-
getSequence
long getSequence()
Returns the sequence number for thisLogEntryobject.A unique, non-negative value that is larger than all previously assigned values since the log implementation was started. These values are transient and are reused upon restart of the log implementation.
- Returns:
- The sequence number for this
LogEntryobject. - Since:
- 1.4
-
getThreadInfo
java.lang.String getThreadInfo()
Returns a string representing the thread which created thisLogEntryobject.This string must contain the name of the thread and may contain other information about the thread.
- Returns:
- A string representing the thread which created this
LogEntryobject. - Since:
- 1.4
-
getLocation
java.lang.StackTraceElement getLocation()
Returns the location information of the creation of thisLogEntryobject.- Returns:
- The location information of the creation of this
LogEntryobject. - Since:
- 1.4
-
-