com.resilientedge.util.logger
Interface LoggerInterface


public interface LoggerInterface

This interface is an afterthought. When we wanted to add a context logger,

Author:
gq

Method Summary
 void addHandler(Handler handler)
          The implementation of this method should add a handler to the Logger's list of Handlers.
 Filter getFilter()
          The implementation of this method should return the Logger's filter.
 java.util.Iterator getHandlers()
          The implementation of this method should return an Iterator for the handlerList.
 boolean isAsync()
          The implementation of this method should return true if the logger can process log records asynchronously.
 boolean isEnabled()
          The implementation of this method should return state of the Logger
 void log(java.lang.String rawMessage)
          This method is for free form trace-logging where the level is assumed to be Trace and the message text does not represent a lookup key.
 void log(java.lang.String rawMessage, int level)
          This method is for free form logging where a level and the logging message are supplied.
 void log(java.lang.String key, java.lang.Object[] insertValues)
          This method is used to trace-log by key.
 void log(java.lang.String key, java.lang.Object[] insertValues, int level)
          This method is used to log by key and level.
 void log(java.lang.String key, java.lang.Object[] insertValues, java.lang.Throwable exception)
          Trace-log by key.
 void log(java.lang.String key, java.lang.Object[] insertValues, java.lang.Throwable exception, int level)
          Log by key and level.
 void log(java.lang.String topic, java.lang.String rawMessage, int level)
          This method is for free form logging where a level and topic are provided in addition to the logging message.
 void log(java.lang.String topic, java.lang.String key, java.lang.Object[] insertValues, int level)
          This method is used to log by lookup key.
 void log(java.lang.String topic, java.lang.String key, java.lang.Object[] insertValues, java.lang.Throwable exception, int level)
          Log a message by lookup key.
 void log(java.lang.String topic, java.lang.String rawMessage, java.lang.Throwable exception, int level)
          Log a message by lookup key.
 void log(java.lang.String rawMessage, java.lang.Throwable exception)
          Log a message and exception.
 void log(java.lang.String rawMessage, java.lang.Throwable exception, int level)
          Log a message, exception and level.
 void log(java.lang.Throwable exception, int level)
          Log an exception with a level but without a message.
 boolean removeHandler(Handler handler)
          The implementation of this method should remove a handler from the Logger's list of handlers.
 void setAsync(boolean async)
          The implementation of this method should set the Logger's ability to process logRecords asynchronously.
 void setEnabled(boolean state)
          The implementation of this method should sets the Logger's logging state.
 void setFilter(Filter filter)
          The implementation of this method should give the Logger a Filter
 

Method Detail

addHandler

public void addHandler(Handler handler)
The implementation of this method should add a handler to the Logger's list of Handlers. This method does not insure uniqueness.
Parameters:
handler - the handler to add.

removeHandler

public boolean removeHandler(Handler handler)
The implementation of this method should remove a handler from the Logger's list of handlers.
Parameters:
handler -  
Returns:
true if the supplied Handler is removed.

getHandlers

public java.util.Iterator getHandlers()
The implementation of this method should return an Iterator for the handlerList.
Returns:
the HandlerList Iterator

setEnabled

public void setEnabled(boolean state)
The implementation of this method should sets the Logger's logging state. A true value means the logger will process log requests. A false value means a logger will not process Log requests.
Parameters:
state - true if the logger can currently log something.

isEnabled

public boolean isEnabled()
The implementation of this method should return state of the Logger
Returns:
true if currently accepting log requests.

setAsync

public void setAsync(boolean async)
The implementation of this method should set the Logger's ability to process logRecords asynchronously. A false value means the logger processes log records synchronously.
Parameters:
async - The new Async value

isAsync

public boolean isAsync()
The implementation of this method should return true if the logger can process log records asynchronously.
Returns:
true if async

setFilter

public void setFilter(Filter filter)
The implementation of this method should give the Logger a Filter
Parameters:
filter - the Logger's Filter.

getFilter

public Filter getFilter()
The implementation of this method should return the Logger's filter.
Returns:
the Logger's Filter.

log

public void log(java.lang.String rawMessage)
This method is for free form trace-logging where the level is assumed to be Trace and the message text does not represent a lookup key.
Parameters:
rawMessage - the log message text or a log message key.

log

public void log(java.lang.String rawMessage,
                int level)
This method is for free form logging where a level and the logging message are supplied.
Parameters:
rawMessage - the log message text or a log message key.
level - the Level of importance or urgency

log

public void log(java.lang.String topic,
                java.lang.String rawMessage,
                int level)
This method is for free form logging where a level and topic are provided in addition to the logging message.
Parameters:
topic - the topic to which the message pertains
rawMessage - the log message text or a log message key.
level - the level of importance or urgency.

log

public void log(java.lang.String topic,
                java.lang.String key,
                java.lang.Object[] insertValues,
                int level)
This method is used to log by lookup key. If a level and/or Topic are supplied, they will override the level and/or topic of the message that corresponds to the supplied key. It is the job of a Handler to peform a lookup and String substitution (if the looked-up message contains String tokens) using the supplied insertValues. While it is up to a Handler's implementation, in most cases, if the key is not found then the the key is logged as the message. Logging will only be peformed if the Logger is enabled and if the level is not blocked by the Logger's Filtergate.
Parameters:
topic - the topic to which the message pertains
key - the log message's key (as stored in resource bundle)
insertValues - the array of objects used for substitution values.
level - the level of importance or urgency.

log

public void log(java.lang.String key,
                java.lang.Object[] insertValues)
This method is used to trace-log by key. If insertValue objects are supplied, then they will be used for string substitution in the looked up string. The topic will be looked-up in addition the message using the supplied key. The level is assumed to be Trace.
Parameters:
key - the log message's key (as stored in resource bundle)
insertValues - the array of objects used for substitution values.

log

public void log(java.lang.String key,
                java.lang.Object[] insertValues,
                int level)
This method is used to log by key and level. If insertValue objects are supplied, then they will be used for string substitution in the looked up string. The topic will be looked-up in addition the message using the supplied key.
Parameters:
key - the log message's key (as stored in resource bundle)
insertValues - the array of objects used for substitution values.
level - the level of importance or urgency.

log

public void log(java.lang.Throwable exception,
                int level)
Log an exception with a level but without a message.
Parameters:
exception - the exception whose stack-trace should be logged.
level - the level of importance or urgency.

log

public void log(java.lang.String rawMessage,
                java.lang.Throwable exception)
Log a message and exception.
Parameters:
rawMessage - the log message text or a log message key.
exception - the exception whose stack-trace should be logged.

log

public void log(java.lang.String rawMessage,
                java.lang.Throwable exception,
                int level)
Log a message, exception and level.
Parameters:
rawMessage - the log message text or a log message key.
exception - the exception whose stack-trace should be logged.
level - the level of importance or urgency.

log

public void log(java.lang.String topic,
                java.lang.String rawMessage,
                java.lang.Throwable exception,
                int level)
Log a message by lookup key. In addition to key, level, topic, insert values and exception must be supplied.
Parameters:
topic - the topic to which the message pertains
exception - the exception whose stack-trace should be logged.
level - the level of importance or urgency.
rawMessage - Parameter Description

log

public void log(java.lang.String topic,
                java.lang.String key,
                java.lang.Object[] insertValues,
                java.lang.Throwable exception,
                int level)
Log a message by lookup key. In addition to key, level, topic, insert values and exception must be supplied.
Parameters:
topic - the topic to which the message pertains
key - the log message's key (as stored in resource bundle)
insertValues - the array of objects used for substitution values.
exception - the exception whose stack-trace should be logged.
level - the level of importance or urgency.

log

public void log(java.lang.String key,
                java.lang.Object[] insertValues,
                java.lang.Throwable exception)
Trace-log by key. InsertValues and exception must be supplied.
Parameters:
key - the log message's key (as stored in resource bundle)
insertValues - the array of objects used for substitution values.
exception - the exception whose stack-trace should be logged.

log

public void log(java.lang.String key,
                java.lang.Object[] insertValues,
                java.lang.Throwable exception,
                int level)
Log by key and level. In addition, Insert Values and exception must be supplied.
Parameters:
key - the log message's key (as stored in resource bundle)
insertValues - the array of objects used for substitution values.
exception - the exception whose stack-trace should be logged.
level - the level of importance or urgency.


Copyright © 2001 Resilient Edge, Inc. All Rights Reserved.