org.apache.webbeans.logger
Class WebBeansLogger

java.lang.Object
  extended by org.apache.webbeans.logger.WebBeansLogger

public final class WebBeansLogger
extends Object

Wrapper class around the log4j logger class to include some checks before the logs are actually written.

Actually, it is a thin layer on the log4j Logger implementation.

Version:
$Rev$ $Date$

Field Summary
static Level WBL_DEBUG
          Log level mappings from OWB DEBUG, TRACE, INFO, WARN, ERROR, FATAL to whatever log levels the currently loaded logger supports (i.e.
static Level WBL_ERROR
           
static Level WBL_FATAL
           
static Level WBL_INFO
           
static Level WBL_TRACE
           
static Level WBL_WARN
           
 
Method Summary
 void debug(String messageKey)
           
 void debug(String messageKey, Object... args)
           
 void debug(String messageKey, Throwable e)
           
 void error(String messageKey)
           
 void error(String messageKey, Object... args)
           
 void error(String messageKey, Throwable e)
           
 void error(String messageKey, Throwable e, Object... args)
           
 void error(Throwable e)
           
 void fatal(String messageKey)
           
 void fatal(String messageKey, Object... args)
           
 void fatal(String messageKey, Throwable e)
           
static WebBeansLogger getLogger(Class<?> clazz)
          Gets the new web beans logger instance.
static WebBeansLogger getLogger(Class<?> clazz, Locale desiredLocale)
          Gets the new web beans logger instance.
 String getTokenString(String messageKey)
           
 void info(String messageKey)
           
 void info(String messageKey, Object... args)
           
 void info(String messageKey, Throwable e)
           
 void setLogger(Logger logger)
          Sets the logger
 void trace(String messageKey)
           
 void trace(String messageKey, Object... args)
           
 void trace(String messageKey, Throwable e)
           
 void warn(String messageKey)
           
 void warn(String messageKey, Object... args)
           
 void warn(String messageKey, Throwable e)
           
 boolean wblWillLogDebug()
           
 boolean wblWillLogError()
           
 boolean wblWillLogFatal()
           
 boolean wblWillLogInfo()
           
 boolean wblWillLogTrace()
           
 boolean wblWillLogWarn()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WBL_DEBUG

public static final Level WBL_DEBUG
Log level mappings from OWB DEBUG, TRACE, INFO, WARN, ERROR, FATAL to whatever log levels the currently loaded logger supports (i.e. JUL provides FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE).


WBL_TRACE

public static final Level WBL_TRACE

WBL_INFO

public static final Level WBL_INFO

WBL_WARN

public static final Level WBL_WARN

WBL_ERROR

public static final Level WBL_ERROR

WBL_FATAL

public static final Level WBL_FATAL
Method Detail

getLogger

public static WebBeansLogger getLogger(Class<?> clazz)
Gets the new web beans logger instance.

Parameters:
clazz - own the return logger
Returns:
new logger

getLogger

public static WebBeansLogger getLogger(Class<?> clazz,
                                       Locale desiredLocale)
Gets the new web beans logger instance.

Parameters:
clazz - own the return logger
desiredLocale - Locale used to select the Message resource bundle.
Returns:
new logger

fatal

public void fatal(String messageKey)

fatal

public void fatal(String messageKey,
                  Object... args)

fatal

public void fatal(String messageKey,
                  Throwable e)

error

public void error(Throwable e)

error

public void error(String messageKey)

error

public void error(String messageKey,
                  Object... args)

error

public void error(String messageKey,
                  Throwable e)

error

public void error(String messageKey,
                  Throwable e,
                  Object... args)

warn

public void warn(String messageKey)

warn

public void warn(String messageKey,
                 Object... args)

warn

public void warn(String messageKey,
                 Throwable e)

info

public void info(String messageKey)

info

public void info(String messageKey,
                 Object... args)

info

public void info(String messageKey,
                 Throwable e)

debug

public void debug(String messageKey)

debug

public void debug(String messageKey,
                  Throwable e)

debug

public void debug(String messageKey,
                  Object... args)

trace

public void trace(String messageKey)

trace

public void trace(String messageKey,
                  Object... args)

trace

public void trace(String messageKey,
                  Throwable e)

getTokenString

public String getTokenString(String messageKey)

setLogger

public void setLogger(Logger logger)
Sets the logger

Parameters:
logger - new logger instance

wblWillLogFatal

public boolean wblWillLogFatal()

wblWillLogError

public boolean wblWillLogError()

wblWillLogWarn

public boolean wblWillLogWarn()

wblWillLogInfo

public boolean wblWillLogInfo()

wblWillLogDebug

public boolean wblWillLogDebug()

wblWillLogTrace

public boolean wblWillLogTrace()


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.