ERXLogger Class Reference

Collaboration diagram for ERXLogger:

Collaboration graph
[legend]

List of all members.

Classes

class  Factory

Public Member Functions

void debugStackTrace (Throwable throwable)
 ERXLogger (String name)

Static Public Member Functions

static synchronized void configureLogging (Properties properties)
static synchronized void configureLoggingWithSystemProperties ()
static ERXLogger getERXLogger (Class clazz, String subTopic)
static ERXLogger getERXLogger (Class clazz)
static ERXLogger getERXLogger (String name)
static Logger getLogger (Class clazz)
static Logger getLogger (String name)

Static Public Attributes

static final String CONFIGURE_LOGGING_WITH_SYSTEM_PROPERTIES = "configureLoggingWithSystemProperties"
static Factory factory = null
static Logger log

Static Package Functions

 [static initializer]


Detailed Description

Custom subclass of Logger. The main reason for this class is to isolate the log4j dependency to only this class. This gives us the freedom in the future to switch logging systems and this should be the only effected class .. in theory.

Constructor & Destructor Documentation

ERXLogger ( String  name  ) 

Default constructor. Constructs a logger for the given name.

Parameters:
name of the logging logger


Member Function Documentation

[static initializer] (  )  [static, package]

static synchronized void configureLogging ( Properties  properties  )  [static]

Sets up the logging system with the given configuration in java.util.Properties format.

Parameters:
properties with the logging configuration

static synchronized void configureLoggingWithSystemProperties (  )  [static]

void debugStackTrace ( Throwable  throwable  ) 

Dumps an Throwable's Stack trace on the appender if debugging is enabled.

Parameters:
throwable throwable to dump

static ERXLogger getERXLogger ( Class  clazz,
String  subTopic 
) [static]

Creates a logger for the given class object plus a restricting subtopic. For instance if you had the class a.b.Foo and you wanted to create a logger for the subtopic 'utilities' for the class Foo then the created logging logger would have the path: a.b.Foo.utilities.

Parameters:
clazz Class object to create the logger for
subTopic to restrict the current logger to
Returns:
logger for the given class and subtopic

static ERXLogger getERXLogger ( Class  clazz  )  [static]

Creates a logger for a given class object. Gets a logger for the fully qualified class name of the given class.

Parameters:
clazz Class object to create the logger for
Returns:
logger for the given class name

static ERXLogger getERXLogger ( String  name  )  [static]

Main entry point for getting an Logger for a given name. Calls getLogger to return the instance of Logger from our custom Factory.

Note that if the log4j system has not been setup correctly, meaning the LoggerFactory subclass has not been correctly put in place, then RuntimeException will be thrown.

Parameters:
name to create the logger for
Returns:
Logger for the given name.

static Logger getLogger ( Class  clazz  )  [static]

static Logger getLogger ( String  name  )  [static]

Overrides method of superclass to return a logger using our custom Logger$Factory class. This works identical to log4.Logger.getLogger

Parameters:
name to create the logger for
Returns:
Logger for the given name.


Member Data Documentation

final String CONFIGURE_LOGGING_WITH_SYSTEM_PROPERTIES = "configureLoggingWithSystemProperties" [static]

Factory factory = null [static]

Logger log [static]

logging supprt


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:16 2012 for Project Wonder by  doxygen 1.5.8