Interface LogService
-
public interface LogServiceProvides methods for bundles to write messages to the log.LogServicemethods are provided to log messages; optionally with aServiceReferenceobject or an exception.Bundles must log messages in the OSGi environment with a severity level according to the following hierarchy:
- Version:
- $Revision: 5654 $
-
-
Field Summary
Fields Modifier and Type Field Description static intLOG_DEBUGA debugging message (Value 4).static intLOG_ERRORAn error message (Value 1).static intLOG_INFOAn informational message (Value 3).static intLOG_WARNINGA warning message (Value 2).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidlog(int level, java.lang.String message)Logs a message.voidlog(int level, java.lang.String message, java.lang.Throwable exception)Logs a message with an exception.voidlog(org.osgi.framework.ServiceReference sr, int level, java.lang.String message)Logs a message associated with a specificServiceReferenceobject.voidlog(org.osgi.framework.ServiceReference sr, int level, java.lang.String message, java.lang.Throwable exception)Logs a message with an exception associated and aServiceReferenceobject.
-
-
-
Field Detail
-
LOG_ERROR
static final int LOG_ERROR
An error message (Value 1).This log entry indicates the bundle or service may not be functional.
- See Also:
- Constant Field Values
-
LOG_WARNING
static final int LOG_WARNING
A warning message (Value 2).This log entry indicates a bundle or service is still functioning but may experience problems in the future because of the warning condition.
- See Also:
- Constant Field Values
-
LOG_INFO
static final int LOG_INFO
An informational message (Value 3).This log entry may be the result of any change in the bundle or service and does not indicate a problem.
- See Also:
- Constant Field Values
-
LOG_DEBUG
static final int LOG_DEBUG
A debugging message (Value 4).This log entry is used for problem determination and may be irrelevant to anyone but the bundle developer.
- See Also:
- Constant Field Values
-
-
Method Detail
-
log
void log(int level, java.lang.String message)Logs a message.The
ServiceReferencefield and theThrowablefield of theLogEntryobject will be set tonull.- Parameters:
level- The severity of the message. This should be one of the defined log levels but may be any integer that is interpreted in a user defined way.message- Human readable string describing the condition ornull.- See Also:
LOG_ERROR,LOG_WARNING,LOG_INFO,LOG_DEBUG
-
log
void log(int level, java.lang.String message, java.lang.Throwable exception)Logs a message with an exception.The
ServiceReferencefield of theLogEntryobject will be set tonull.- Parameters:
level- The severity of the message. This should be one of the defined log levels but may be any integer that is interpreted in a user defined way.message- The human readable string describing the condition ornull.exception- The exception that reflects the condition ornull.- See Also:
LOG_ERROR,LOG_WARNING,LOG_INFO,LOG_DEBUG
-
log
void log(org.osgi.framework.ServiceReference sr, int level, java.lang.String message)Logs a message associated with a specificServiceReferenceobject.The
Throwablefield of theLogEntrywill be set tonull.- Parameters:
sr- TheServiceReferenceobject of the service that this message is associated with ornull.level- The severity of the message. This should be one of the defined log levels but may be any integer that is interpreted in a user defined way.message- Human readable string describing the condition ornull.- See Also:
LOG_ERROR,LOG_WARNING,LOG_INFO,LOG_DEBUG
-
log
void log(org.osgi.framework.ServiceReference sr, int level, java.lang.String message, java.lang.Throwable exception)Logs a message with an exception associated and aServiceReferenceobject.- Parameters:
sr- TheServiceReferenceobject of the service that this message is associated with.level- The severity of the message. This should be one of the defined log levels but may be any integer that is interpreted in a user defined way.message- Human readable string describing the condition ornull.exception- The exception that reflects the condition ornull.- See Also:
LOG_ERROR,LOG_WARNING,LOG_INFO,LOG_DEBUG
-
-