Interface LogEntry
A LogEntry object may be acquired from the
LogReaderService.getLog method or by registering a
LogListener object.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the bundle that created thisLogEntryobject.Returns the exception object associated with thisLogEntryobject.intgetLevel()Deprecated.Since 1.4.default StackTraceElementReturns the location information of the creation of thisLogEntryobject.default StringReturns the name of theLoggerobject used to create thisLogEntryobject.default LogLevelReturns the level of thisLogEntryobject.Returns the formatted message associated with thisLogEntryobject.default longReturns the sequence number for thisLogEntryobject.Returns theServiceReferenceobject for the service associated with thisLogEntryobject.default StringReturns a string representing the thread which created thisLogEntryobject.longgetTime()Returns the value ofcurrentTimeMillis()at the time thisLogEntryobject was created.
-
Method Details
-
getBundle
Bundle getBundle()Returns the bundle that created thisLogEntryobject.- Returns:
- The bundle that created this
LogEntryobject;nullif no bundle is associated with thisLogEntryobject.
-
getServiceReference
ServiceReference<?> getServiceReference()Returns theServiceReferenceobject for the service associated with thisLogEntryobject.- Returns:
ServiceReferenceobject for the service associated with thisLogEntryobject;nullif noServiceReferenceobject was provided.
-
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
String getMessage()Returns the formatted message associated with thisLogEntryobject.- Returns:
Stringcontaining the formatted message associated with thisLogEntryobject.
-
getException
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
Returns the level of thisLogEntryobject.- Returns:
- The level of this
LogEntryobject. - Since:
- 1.4
-
getLoggerName
Returns the name of theLoggerobject used to create thisLogEntryobject.- Returns:
- The name of the
Loggerobject used to create thisLogEntryobject. - Since:
- 1.4
-
getSequence
default 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
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
Returns the location information of the creation of thisLogEntryobject.- Returns:
- The location information of the creation of this
LogEntryobject. - Since:
- 1.4
-