org.okiproject.serviceapi.logging
Interface Logger

All Superinterfaces:
java.io.Serializable

public interface Logger
extends java.io.Serializable

Purpose: Represents the logging strategy used, allowing replaceable logging strategies.

Copyright (c) 2001 Massachusetts Institute of Technology

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

$Source: /cvs/oki/org/okiproject/serviceapi/doc/logging/org/okiproject/serviceapi/logging/Logger.html,v $


Method Summary
 void appendLog(org.okiproject.serviceapi.common.Agent who, Priority priority, java.lang.String message)
          Workhorse used to append to the log
 void debug(org.okiproject.serviceapi.common.Agent who, java.lang.String message)
          Add a debug level message to the log.
 void error(org.okiproject.serviceapi.common.Agent who, java.lang.String message)
          Add a error level message to the log.
 void fatal(org.okiproject.serviceapi.common.Agent who, java.lang.String message)
          Add a fatal level message to the log.
 Formatter getFormatter(org.okiproject.serviceapi.common.Agent who)
          Method getFormatter
 void info(org.okiproject.serviceapi.common.Agent who, java.lang.String message)
          Add an informational message to the log.
 int readLog(org.okiproject.serviceapi.common.Agent who, byte[] b, int offset, int count)
          An interface to read the logger.
 java.util.Iterator readLog(org.okiproject.serviceapi.common.Agent who, java.lang.String queryString)
          Another interface to read the logger.
 void setBasePriority(org.okiproject.serviceapi.common.Agent who, Priority priority)
          This is needed to tell the individual ILoggers what the base priority of the logging service is.
 void setFormatter(org.okiproject.serviceapi.common.Agent who, Formatter formatter)
          JavaBean patterns
 void start(org.okiproject.serviceapi.common.Agent who)
          To open the log
 void stop(org.okiproject.serviceapi.common.Agent who)
          To close the log
 void warning(org.okiproject.serviceapi.common.Agent who, java.lang.String message)
          Add a warning level message to the log.
 

Method Detail

start

public void start(org.okiproject.serviceapi.common.Agent who)
To open the log

stop

public void stop(org.okiproject.serviceapi.common.Agent who)
To close the log

appendLog

public void appendLog(org.okiproject.serviceapi.common.Agent who,
                      Priority priority,
                      java.lang.String message)
Workhorse used to append to the log

setBasePriority

public void setBasePriority(org.okiproject.serviceapi.common.Agent who,
                            Priority priority)
This is needed to tell the individual ILoggers what the base priority of the logging service is.
Parameters:
who - Represents the Agent state for authn/authz purposes.
priority - IPriority representing the logging service's base priority.

warning

public void warning(org.okiproject.serviceapi.common.Agent who,
                    java.lang.String message)
Add a warning level message to the log.

info

public void info(org.okiproject.serviceapi.common.Agent who,
                 java.lang.String message)
Add an informational message to the log.

debug

public void debug(org.okiproject.serviceapi.common.Agent who,
                  java.lang.String message)
Add a debug level message to the log.

error

public void error(org.okiproject.serviceapi.common.Agent who,
                  java.lang.String message)
Add a error level message to the log.

fatal

public void fatal(org.okiproject.serviceapi.common.Agent who,
                  java.lang.String message)
Add a fatal level message to the log.

readLog

public int readLog(org.okiproject.serviceapi.common.Agent who,
                   byte[] b,
                   int offset,
                   int count)
            throws java.lang.Exception
An interface to read the logger. It is assumed that any semantics on the format on the log will be set by the application, which will also know how to parse and reformat the messages for reporting or viewing purposes, and handle presentation aspects as it sees fit. Only a low-level access to the contents is provided via this interface.
Parameters:
who - Represents the Agent state for authn/authz purposes.
b - Destination array.
offset -  
count - # of bytes to read.
Returns:
 
Throws:
java.lang.Exception - if any I/O or other error occurs. Semantic errors include trying to read handle that cannot be read from, such as stderr, stdout.

readLog

public java.util.Iterator readLog(org.okiproject.serviceapi.common.Agent who,
                                  java.lang.String queryString)
                           throws java.lang.Exception
Another interface to read the logger. This would return an enumeration of all messages matching a certain query string.
Parameters:
who - Represents the Agent state for authn/authz purposes.
queryString - Represents tag(s) to look for in the message
Returns:
 
Throws:
java.lang.Exception - if any I/O or other error occurs.

setFormatter

public void setFormatter(org.okiproject.serviceapi.common.Agent who,
                         Formatter formatter)
JavaBean patterns

getFormatter

public Formatter getFormatter(org.okiproject.serviceapi.common.Agent who)
Method getFormatter
Parameters:
who -  
Returns: