Top Description Methods
org.osgi.service.log

public Interface LogEntry

Annotations
@ProviderType
Imports
org.osgi.annotation.versioning.ProviderType, org.osgi.framework.Bundle, .ServiceReference

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.

Author
$Id: 9dca75876a3be67c923cd5a55b59dd63f69d6fbc $

Method Summary

Modifier and TypeMethod and Description
public Bundle

Returns:

The bundle that created this LogEntry object; null if no bundle is associated with this LogEntry object.
getBundle
()

Returns the bundle that created this LogEntry object.

public Throwable

Returns:

Throwable object of the exception associated with this LogEntry;null if no exception is associated with this LogEntry object.
getException
()

Returns the exception object associated with this LogEntry object.

public int

Returns:

Integer level of this LogEntry object.
getLevel
()
Deprecated Since 1.4. Replaced by getLogLevel().

Returns the integer level of this LogEntry object.

public StackTraceElement

Returns:

The location information of the creation of this LogEntry object.
getLocation
()

Returns the location information of the creation of this LogEntry object.

public String

Returns:

The name of the Logger object used to create this LogEntry object.
getLoggerName
()

Returns the name of the Logger object used to create this LogEntry object.

public LogLevel

Returns:

The level of this LogEntry object.
getLogLevel
()

Returns the level of this LogEntry object.

public String

Returns:

String containing the formatted message associated with this LogEntry object.
getMessage
()

Returns the formatted message associated with this LogEntry object.

public long

Returns:

The sequence number for this LogEntry object.
getSequence
()

Returns the sequence number for this LogEntry object.

public ServiceReference<?>

Returns:

ServiceReference object for the service associated with this LogEntry object; null if no ServiceReference object was provided.
getServiceReference
()

Returns the ServiceReference object for the service associated with this LogEntry object.

public String

Returns:

A string representing the thread which created this LogEntry object.
getThreadInfo
()

Returns a string representing the thread which created this LogEntry object.

public long

Returns:

The system time in milliseconds when this LogEntry object was created.
getTime
()

Returns the value of currentTimeMillis() at the time this LogEntry object was created.

Method Detail

getBundleback to summary
public Bundle getBundle()

Returns the bundle that created this LogEntry object.

Returns:Bundle

The bundle that created this LogEntry object; null if no bundle is associated with this LogEntry object.

getExceptionback to summary
public Throwable getException()

Returns the exception object associated with this LogEntry 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

Throwable object of the exception associated with this LogEntry;null if no exception is associated with this LogEntry object.

getLevelback to summary
public int getLevel()

Deprecated

Since 1.4. Replaced by getLogLevel().

Returns the integer level of this LogEntry object.

If one of the log methods of LogService was used, this is the specified integer level. Otherwise, this is the ordinal value of the log level.

Returns:int

Integer level of this LogEntry object.

Annotations
@Deprecated
getLocationback to summary
public StackTraceElement getLocation()

Returns the location information of the creation of this LogEntry object.

Returns:StackTraceElement

The location information of the creation of this LogEntry object.

Since
1.4
getLoggerNameback to summary
public String getLoggerName()

Returns the name of the Logger object used to create this LogEntry object.

Returns:String

The name of the Logger object used to create this LogEntry object.

Since
1.4
getLogLevelback to summary
public LogLevel getLogLevel()

Returns the level of this LogEntry object.

Returns:LogLevel

The level of this LogEntry object.

Since
1.4
getMessageback to summary
public String getMessage()

Returns the formatted message associated with this LogEntry object.

Returns:String

String containing the formatted message associated with this LogEntry object.

getSequenceback to summary
public long getSequence()

Returns the sequence number for this LogEntry 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:long

The sequence number for this LogEntry object.

Since
1.4
getServiceReferenceback to summary
public ServiceReference<?> getServiceReference()

Returns the ServiceReference object for the service associated with this LogEntry object.

Returns:ServiceReference<?>

ServiceReference object for the service associated with this LogEntry object; null if no ServiceReference object was provided.

getThreadInfoback to summary
public String getThreadInfo()

Returns a string representing the thread which created this LogEntry object.

This string must contain the name of the thread and may contain other information about the thread.

Returns:String

A string representing the thread which created this LogEntry object.

Since
1.4
getTimeback to summary
public long getTime()

Returns the value of currentTimeMillis() at the time this LogEntry object was created.

Returns:long

The system time in milliseconds when this LogEntry object was created.

See Also
System.currentTimeMillis()