com.jaxfront.core.log
Class Log4JLogRegistry

java.lang.Object
  extended by com.jaxfront.core.log.Log4JLogRegistry
All Implemented Interfaces:
Logger

public class Log4JLogRegistry
extends java.lang.Object
implements Logger

This class logs all message with Log4J. With the property file of Log4J the message could be loged in a file or to the console. This class delegates the messages to Log4J.

Version:
1.60

Field Summary
static java.lang.String ERROR
           
static java.lang.String FATAL
           
static java.lang.String INFO
           
static java.lang.String LOG
           
static java.lang.String WARN
           
 
Constructor Summary
Log4JLogRegistry()
          Creates an instance of a Log4J Logger.
 
Method Summary
 void error(java.lang.Class aClass, java.lang.Exception e)
          Log the exception with log level error
 void error(java.lang.Class aClass, java.lang.String message)
          Log the message with log level error
 void fatal(java.lang.Class aClass, java.lang.Exception e)
          Log the exception with log level fatal
 void fatal(java.lang.Class aClass, java.lang.String message)
          Log the message with log level fatal
 java.lang.String getLogFileUrl()
           
 void info(java.lang.Class aClass, java.lang.String message)
          Log the message with log level info
 boolean isDebug()
           
 void log(java.lang.Class aClass, java.lang.String message)
          Log the message with log level log
 void setAppender(org.apache.log4j.Appender newAppender)
          Set an user defined appender to log the message to this appender.
 void setDebug(boolean isDebug)
           
 void setLogFileUrl(java.lang.String url)
           
 void setLogLevels(java.lang.String[] logLevels)
           
 void warn(java.lang.Class aClass, java.lang.String message)
          Log the message with log level warn
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR

public static final java.lang.String ERROR
See Also:
Constant Field Values

WARN

public static final java.lang.String WARN
See Also:
Constant Field Values

FATAL

public static final java.lang.String FATAL
See Also:
Constant Field Values

LOG

public static final java.lang.String LOG
See Also:
Constant Field Values

INFO

public static final java.lang.String INFO
See Also:
Constant Field Values
Constructor Detail

Log4JLogRegistry

public Log4JLogRegistry()
Creates an instance of a Log4J Logger.

Method Detail

error

public void error(java.lang.Class aClass,
                  java.lang.Exception e)
Log the exception with log level error

Specified by:
error in interface Logger
Parameters:
aClass - the class where the message comes
e - the exception to log

error

public void error(java.lang.Class aClass,
                  java.lang.String message)
Log the message with log level error

Specified by:
error in interface Logger
Parameters:
aClass - the class where the message comes
message - the message to log

fatal

public void fatal(java.lang.Class aClass,
                  java.lang.Exception e)
Log the exception with log level fatal

Specified by:
fatal in interface Logger
Parameters:
aClass - the class where the message comes
e - the exception to log

fatal

public void fatal(java.lang.Class aClass,
                  java.lang.String message)
Log the message with log level fatal

Specified by:
fatal in interface Logger
Parameters:
aClass - the class where the message comes
message - the message to log

info

public void info(java.lang.Class aClass,
                 java.lang.String message)
Log the message with log level info

Specified by:
info in interface Logger
Parameters:
aClass - the class where the message comes
message - the message to log

log

public void log(java.lang.Class aClass,
                java.lang.String message)
Log the message with log level log

Specified by:
log in interface Logger
Parameters:
aClass - the class where the message comes
message - the message to log

setAppender

public void setAppender(org.apache.log4j.Appender newAppender)
Set an user defined appender to log the message to this appender.

Parameters:
newAppender - the user defined appender.

warn

public void warn(java.lang.Class aClass,
                 java.lang.String message)
Log the message with log level warn

Specified by:
warn in interface Logger
Parameters:
aClass - the class where the message comes
message - the message to log

setLogFileUrl

public void setLogFileUrl(java.lang.String url)
Specified by:
setLogFileUrl in interface Logger

getLogFileUrl

public java.lang.String getLogFileUrl()
Specified by:
getLogFileUrl in interface Logger

setLogLevels

public void setLogLevels(java.lang.String[] logLevels)
Specified by:
setLogLevels in interface Logger

isDebug

public boolean isDebug()

setDebug

public void setDebug(boolean isDebug)