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 thisLogEntry
object.Returns the exception object associated with thisLogEntry
object.int
getLevel()
Deprecated.Since 1.4.default StackTraceElement
Returns the location information of the creation of thisLogEntry
object.default String
Returns the name of theLogger
object used to create thisLogEntry
object.default LogLevel
Returns the level of thisLogEntry
object.Returns the formatted message associated with thisLogEntry
object.default long
Returns the sequence number for thisLogEntry
object.Returns theServiceReference
object for the service associated with thisLogEntry
object.default String
Returns a string representing the thread which created thisLogEntry
object.long
getTime()
Returns the value ofcurrentTimeMillis()
at the time thisLogEntry
object was created.
-
Method Details
-
getBundle
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
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
Deprecated.Since 1.4. Replaced bygetLogLevel()
.Returns the integer level of thisLogEntry
object.If one of the
log
methods ofLogService
was used, this is the specified integer level. Otherwise, this is theordinal
value of thelog level
.- Returns:
- Integer level of this
LogEntry
object.
-
getMessage
String getMessage()Returns the formatted message associated with thisLogEntry
object.- Returns:
String
containing the formatted 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:
-
- "System.currentTimeMillis()"
-
getLogLevel
Returns the level of thisLogEntry
object.- Returns:
- The level of this
LogEntry
object. - Since:
- 1.4
-
getLoggerName
Returns the name of theLogger
object used to create thisLogEntry
object.- Returns:
- The name of the
Logger
object used to create thisLogEntry
object. - Since:
- 1.4
-
getSequence
default long getSequence()Returns the sequence number for thisLogEntry
object.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
LogEntry
object. - Since:
- 1.4
-
getThreadInfo
Returns a string representing the thread which created thisLogEntry
object.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
LogEntry
object. - Since:
- 1.4
-
getLocation
Returns the location information of the creation of thisLogEntry
object.- Returns:
- The location information of the creation of this
LogEntry
object. - Since:
- 1.4
-