com.jaxfront.core.log
Class LogRegistry

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

public class LogRegistry
extends java.lang.Object
implements Logger

This is the main class to log a message. First it tries to create an instance of the Log4J logger. If it failes, a dummy logger will be used.

See Also:
LogRegistry, DummyLogRegistry

Method Summary
 void error(java.lang.Class aClass, java.lang.Exception e)
          Log the exception with log level error to the coosen logger
 void error(java.lang.Class aClass, java.lang.String message)
          Log the message with log level error to the coosen logger
 void errorDB(java.lang.Class aClass, java.lang.String message)
           
 void errorRule(java.lang.Class aClass, java.lang.String message)
           
 void fatal(java.lang.Class aClass, java.lang.Exception e)
          Log the exception with log level fatal to the coosen logger
 void fatal(java.lang.Class aClass, java.lang.String message)
          Log the message with log level fatal
static LogRegistry getInstance()
          Returns the instance of this class
static org.apache.log4j.Logger getJDBCLogger()
           
 java.lang.String getLogFileUrl()
           
 Logger getLogger()
          Returns the choosen logger that has been build.
 void info(java.lang.Class aClass, java.lang.String message)
          Log the message with log level info
 void infoDB(java.lang.Class aClass, java.lang.String message)
           
 void infoRule(java.lang.Class aClass, java.lang.String message)
           
 boolean isDebug()
           
 void log(java.lang.Class aClass, java.lang.String message)
          Log the message with log level log to the coosen logger
 boolean logErrors()
           
 boolean logFatals()
           
 boolean logInfos()
           
 boolean logLogs()
           
 boolean logWarnings()
           
 void setLogFileUrl(java.lang.String url)
           
 void setLogger(Logger logger)
           
 void setLogLevels(java.lang.String[] logLevels)
           
 void warn(java.lang.Class aClass, java.lang.String message)
          Log the message with log level warn to the choosen logger
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

error

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

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 to the coosen logger

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

errorDB

public void errorDB(java.lang.Class aClass,
                    java.lang.String message)

errorRule

public void errorRule(java.lang.Class aClass,
                      java.lang.String message)

fatal

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

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

getInstance

public static LogRegistry getInstance()
Returns the instance of this class

Returns:
an instance of this class

getJDBCLogger

public static org.apache.log4j.Logger getJDBCLogger()

getLogFileUrl

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

getLogger

public Logger getLogger()
Returns the choosen logger that has been build.

Returns:
the choosen logger

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

infoDB

public void infoDB(java.lang.Class aClass,
                   java.lang.String message)

infoRule

public void infoRule(java.lang.Class aClass,
                     java.lang.String message)

isDebug

public boolean isDebug()

log

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

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

logErrors

public boolean logErrors()
Specified by:
logErrors in interface Logger

logFatals

public boolean logFatals()
Specified by:
logFatals in interface Logger

logInfos

public boolean logInfos()
Specified by:
logInfos in interface Logger

logLogs

public boolean logLogs()
Specified by:
logLogs in interface Logger

logWarnings

public boolean logWarnings()
Specified by:
logWarnings in interface Logger

setLogFileUrl

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

setLogger

public void setLogger(Logger logger)

setLogLevels

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

warn

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

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