LogService

Syntax

public interface LogService

Description

The LogService provides methods for bundles to write messages to the log. Methods are provide to log messages with or without a ServiceDescription or an exception. Messages must be logged with a log level. The log levels have the following hierarchy:

  1. LOG_ERROR

  2. LOG_WARNING

  3. LOG_INFO

  4. LOG_DEBUG

Member Summary
Fields
public static finalLOG_DEBUG
 A debugging message.
public static finalLOG_ERROR
 An error message.
public static final LOG_INFO
 An informational message.
public static finalLOG_WARNING
 A warning message.
Methods
public voidlog(int, String)
 Log a message.
public voidlog(int, String, Throwable)
 Log a message with an exception.
public voidlog(ServiceReference, int, String)
 Log a message associated with a specific Service.
public voidlog(ServiceReference, int, String, Throwable)
 Log a message with an exception associated with a specific Service.

Fields

LOG_DEBUG
public static final int LOG_DEBUG
						

A debugging message. Used for problem determination and may be meaningless to anyone but the developer.

LOG_ERROR
public static final int LOG_ERROR
						

An error message. The bundle or service may not be functional.

LOG_INFO
public static final int LOG_INFO
						

An informational message. This log entry may be the result of any change in the bundle or service and does not indicate a problem.

LOG_WARNING
public static final int LOG_WARNING
						

A warning message. The bundle or service is still functioning but may experience problems in the future because of the condition.

Methods

log(int, String)
public void log(int level, java.lang.String message)

Log a message. The ServiceDescription field and the Throwable field of the LogEntry will be set to null.

Parameters:

level— The severity of the message. (Should be one of the four predefined severities.)

message— Human readable string describing the condition.

log(int, String, Throwable)
public void log(int level, java.lang.String message,
            java.lang.Throwable exception)

Log a message with an exception. The ServiceDescription field of the LogEntry will be set to null.

Parameters:

level— The severity of the message. (Should be one of the four predefined severities.)

message— Human readable string describing the condition.

exception— The exception that reflects the condition.

log(ServiceReference, int, String)
public void log(ServiceReference sr, int level,
            java.lang.String message)

Log a message associated with a specific Service. The Throwable field of the LogEntry will be set to null.

Parameters:

sr— The ServiceReference of the service that this message is associated with.

level— The severity of the message. (Should be one of the four predefined severities.)

message— Human readable string describing the condition.

log(ServiceReference, int, String, Throwable)
public void log(ServiceReference sr, int level,
            java.lang.String message,
            java.lang.Throwable exception)

Log a message with an exception associated with a specific Service.

Parameters:

sr— The ServiceReference of the service that this message is associated with.

level— The severity of the message. (Should be one of the four predefined severities.)

message— Human readable string describing the condition.

exception— The exception that reflects the condition.

OSGi Service Gateway Specification

Copyright Information

Copyright © The Open Services Gateway Initiative (2000). All Rights Reserved. Implementation of certain elements of the Open Services Gateway Initiative (OSGI) Specification may be subject to third party intellectual property rights, including without limitation, patent rights (such a third party may or may not be a member of OSGi). OSGi is not responsible and shall not be held responsible in any manner for identifying or failing to identify any or all such third party intellectual property rights. This document and the information contained herein are provided on an “AS IS” basis and OSGI DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS AND ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL OSGI BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF USE OF DATA, INTERRUPTION OF BUSINESS, OR FOR DIRECT, INDIRECT, SPECIAL OR EXEMPLARY, INCIDENTIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND IN CONNECTION WITH THIS DOCUMENT OR THE INFORMATION CONTAINED HEREIN, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.

All Company, brand and product names may be trademarks that are the sole property of their respective owners. All rights reserved.

Permission to reprint the specification shall in no way imply any endorsement of this publication and its content by OSGi. Nor shall it imply any endorsement by OSGi of any vendors' implementation of the OSGi specification. OSGi encourages readers to visit its Web site, www.osgi.org, for updated versions of the specification.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.146.155