com.rhi.architecture.logging
Class Logger

java.lang.Object
  extended bycom.rhi.architecture.logging.Logger
All Implemented Interfaces:
Resource
Direct Known Subclasses:
DefaultLogger, JDK14Logger, Log4JLogger

public abstract class Logger
extends java.lang.Object
implements Resource

Logger interface

Since:
1.2
Author:
Pete McKinstry

Field Summary
static java.lang.String DEFAULT_CATEGORY
          default category to use
static java.lang.String KEY
          ResourceContext key used to load correct Logger type
 
Constructor Summary
Logger()
           
 
Method Summary
abstract  void close()
          Perform whatever cleanup is required of the underlying object..
abstract  void debug(java.lang.String message)
          Log a message w/ a debug priority.
abstract  void error(java.lang.String message)
          Log a message w/ an error priority.
abstract  void error(java.lang.String message, java.lang.Throwable t)
          Log a message w/ an error priority.
abstract  void fatal(java.lang.String message)
          Log a message w/ a fatal priority.
abstract  void fatal(java.lang.String message, java.lang.Throwable t)
          Log a message w/ a fatal priority.
abstract  void info(java.lang.String message)
          Log a message w/ an informational priority.
abstract  void init(java.util.Properties p)
          Perform whatever initialization is required of the resource.
abstract  boolean isDebugEnabled()
          Check whether this category is enabled for the DEBUG Level.
abstract  boolean isInfoEnabled()
          Check whether this category is enabled for the INFO Level.
abstract  boolean isTraceEnabled()
          Check whether this category is enabled for the TRACE Level.
abstract  boolean isWarningEnabled()
          Check whether this category is enabled for the WARNING Level.
abstract  void trace(java.lang.String message)
          Log a message w/ a trace priority.
abstract  void warning(java.lang.String message)
          Log a message w/ a warning priority.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

public static final java.lang.String KEY
ResourceContext key used to load correct Logger type

See Also:
Constant Field Values

DEFAULT_CATEGORY

public static final java.lang.String DEFAULT_CATEGORY
default category to use

See Also:
Constant Field Values
Constructor Detail

Logger

public Logger()
Method Detail

init

public abstract void init(java.util.Properties p)
                   throws InitializationException
Perform whatever initialization is required of the resource.

Specified by:
init in interface Resource
Parameters:
p -
Throws:
InitializationException
Since:
1.2

close

public abstract void close()
Perform whatever cleanup is required of the underlying object..

Specified by:
close in interface Resource
Since:
1.2

fatal

public abstract void fatal(java.lang.String message)
Log a message w/ a fatal priority. Fatal messages are usually not recoverable & will precede an application shutdown. Actual support for this priority is log implementation specific, but should be available in most packages. (e.g. Log4J, JDK1.4)

Parameters:
message - - log message
Since:
1.0

fatal

public abstract void fatal(java.lang.String message,
                           java.lang.Throwable t)
Log a message w/ a fatal priority. Fatal messages are usually not recoverable & will precede an application shutdown. Actual support for this priority is log implementation specific, but should be available in most packages. (e.g. Log4J, JDK1.4)

Parameters:
message - - log message
t - - exception causing fatal error
Since:
1.0

error

public abstract void error(java.lang.String message)
Log a message w/ an error priority. Errors are used for problems found during processing that are not fatal. Actual support for this priority is log implementation specific, but should be available in most packages. (e.g. Log4J, JDK1.4)

Parameters:
message - - log message
Since:
1.0

error

public abstract void error(java.lang.String message,
                           java.lang.Throwable t)
Log a message w/ an error priority. Errors are used for problems found during processing that are not fatal. Actual support for this priority is log implementation specific, but should be available in most packages. (e.g. Log4J, JDK1.4)

Parameters:
message - - log message
t - - exception causing error
Since:
1.0

warning

public abstract void warning(java.lang.String message)
Log a message w/ a warning priority. Warnings are useful for messages that signal an error in the future if not corrected. (e.g. low disk space) or potential errors that may not be a problem depending on context that the logging component does not have. Actual support for this priority is log implementation specific, but should be available in most packages. (e.g. Log4J, JDK1.4)

Parameters:
message - - log message
Since:
1.01

isWarningEnabled

public abstract boolean isWarningEnabled()
Check whether this category is enabled for the WARNING Level.

Returns:
boolean
Since:
1.0

info

public abstract void info(java.lang.String message)
Log a message w/ an informational priority. Informational messages will include things like operational statistics, which are nice to have, but don't signal an error of any kind in the application. The number of informational messages used in a process should be very low. Actual support for this priority is log implementation specific, but should be available in most packages. (e.g. Log4J, JDK1.4)

Parameters:
message - - log message
Since:
1.01

isInfoEnabled

public abstract boolean isInfoEnabled()
Check whether this category is enabled for the INFO Level.

Returns:
boolean
Since:
1.0

debug

public abstract void debug(java.lang.String message)
Log a message w/ a debug priority. Debug messages are normally be disabled in production environments, but can be quite useful during development.

Parameters:
message - - log message
Since:
1.01

isDebugEnabled

public abstract boolean isDebugEnabled()
Check whether this category is enabled for the DEBUG Level.

Returns:
boolean
Since:
1.0

trace

public abstract void trace(java.lang.String message)
Log a message w/ a trace priority. Trace messages are the most granular and will normally be disabled in production environments, but can be quite useful during development. If the underlying logging implementation does not support this level, trace messages should be logged w/ the most verbose logging level available.

Parameters:
message - - log message
Since:
1.01

isTraceEnabled

public abstract boolean isTraceEnabled()
Check whether this category is enabled for the TRACE Level.

Returns:
boolean
Since:
1.0


Copyright © 2002-2004 Robert Half International. All Rights Reserved.