com.rhi.architecture.logging
Class BasicLog4JFactory

java.lang.Object
  extended bycom.rhi.architecture.logging.LogFactory
      extended bycom.rhi.architecture.logging.BasicLog4JFactory
All Implemented Interfaces:
Resource
Direct Known Subclasses:
Log4JFactory

public class BasicLog4JFactory
extends LogFactory

The Log4JFactory/Log4JLogger are holdovers from a specific system that required some special configuration. These special settings complicated the usage pattern, and so this class has been provided for other users who wish to use Log4j, but dont' want/need to inherit the baggage from that system. It performs only the absolute minimum configuration & leaves everything else up to Log4j itself.

Version:
1.0
Author:
Pete McKinstry

Field Summary
static java.lang.String LOG4J_DEFAULTCATEGORY
          the default category to use when logging.
static java.lang.String LOG4J_PROPERTYFILE
          config entry specifying the log4j configuration file to use.
 
Fields inherited from class com.rhi.architecture.logging.LogFactory
KEY
 
Constructor Summary
BasicLog4JFactory()
          default constructor - protected
 
Method Summary
 void close()
          Perform any required cleanup.
 Logger getDefaultLogger()
          Get default logger.
 Logger getLogger(java.lang.String type)
          Get a logger instance for the provided type.
protected  java.util.Properties getProperties()
          Returns the properties.
 void init(java.util.Properties p)
          Perform whatever initialization is required of the resource.
protected  boolean isLoaded()
          Returns the loaded.
 
Methods inherited from class com.rhi.architecture.logging.LogFactory
getFactory, getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG4J_PROPERTYFILE

public static final java.lang.String LOG4J_PROPERTYFILE
config entry specifying the log4j configuration file to use.

See Also:
Constant Field Values

LOG4J_DEFAULTCATEGORY

public static final java.lang.String LOG4J_DEFAULTCATEGORY
the default category to use when logging.

See Also:
Constant Field Values
Constructor Detail

BasicLog4JFactory

public BasicLog4JFactory()
default constructor - protected

Since:
1.0
Method Detail

init

public void init(java.util.Properties p)
          throws InitializationException
Perform whatever initialization is required of the resource. This method should only be called once per application instance.

Parameters:
p -
Throws:
InitializationException
Since:
1.2

getProperties

protected java.util.Properties getProperties()
Returns the properties.

Returns:
Properties

close

public void close()
Perform any required cleanup.

Since:
1.0

getLogger

public Logger getLogger(java.lang.String type)
                 throws ConfigurationException
Description copied from class: LogFactory
Get a logger instance for the provided type.

Specified by:
getLogger in class LogFactory
Parameters:
type -
Returns:
Throws:
ConfigurationException
See Also:
LogFactory.getLogger(String)

getDefaultLogger

public Logger getDefaultLogger()
                        throws ConfigurationException
Get default logger. This method exists to support backward compatibility prior to the factory class. Prefer getLogger(String type) instead.

Specified by:
getDefaultLogger in class LogFactory
Returns:
Logger
Throws:
ConfigurationException

isLoaded

protected boolean isLoaded()
Returns the loaded.

Returns:
boolean


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