public interface LogService
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:
LOG_ERROR
LOG_WARNING
LOG_INFO
LOG_DEBUG
public static final int LOG_DEBUG
A debugging message. Used for problem determination and may be meaningless to anyone but the developer.
public static final int LOG_ERROR
An error message. The bundle or service may not be functional.
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.
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.
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.)
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.)
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.)
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.)
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.
18.117.146.155