org.jboss.logging.log4j
Class Log4jLoggerPlugin

java.lang.Object
  extended by org.jboss.logging.log4j.Log4jLoggerPlugin
All Implemented Interfaces:
org.jboss.logging.LoggerPlugin, org.jboss.logging.MDCSupport, org.jboss.logging.NDCSupport
Direct Known Subclasses:
Log4jLoggerPlugin

public class Log4jLoggerPlugin
extends Object
implements org.jboss.logging.LoggerPlugin, org.jboss.logging.NDCSupport, org.jboss.logging.MDCSupport

Delegate for org.jboss.logging.Logger logging to log4j. Body of implementation mainly copied from old Logger implementation.

Version:
$Revision: 3160 $
Author:
Sacha Labourey., Jason T. Greene
See Also:
Logger, LoggerPlugin

Constructor Summary
Log4jLoggerPlugin()
           
 
Method Summary
 void debug(Object message)
          Issue a log msg with a level of DEBUG.
 void debug(Object message, Throwable t)
          Issue a log msg and throwable with a level of DEBUG.
 void debug(String loggerFcqn, Object message, Throwable t)
          
 void error(Object message)
          Issue a log msg with a level of ERROR.
 void error(Object message, Throwable t)
          Issue a log msg and throwable with a level of ERROR.
 void error(String loggerFcqn, Object message, Throwable t)
          
 void fatal(Object message)
          Issue a log msg with a level of FATAL.
 void fatal(Object message, Throwable t)
          Issue a log msg and throwable with a level of FATAL.
 void fatal(String loggerFcqn, Object message, Throwable t)
          
 org.apache.log4j.Category getCategory()
           
 org.apache.log4j.Logger getLogger()
          Exposes the delegate Log4j Logger.
 org.jboss.logging.MDCProvider getMDCProvider()
           
 org.jboss.logging.NDCProvider getNDCProvider()
           
 void info(Object message)
          Issue a log msg with a level of INFO.
 void info(Object message, Throwable t)
          Issue a log msg and throwable with a level of INFO.
 void info(String loggerFcqn, Object message, Throwable t)
          
 void init(String name)
           
 boolean isDebugEnabled()
          Deprecated. 
 boolean isInfoEnabled()
          Deprecated. 
 boolean isTraceEnabled()
           
 void log(org.apache.log4j.Level l, Object message)
          Issue a log msg with the given level.
 void log(org.apache.log4j.Level l, Object message, Throwable t)
          Issue a log msg with the given level.
 void log(org.apache.log4j.Priority p, Object message)
          Deprecated. Use Level versions.
 void log(org.apache.log4j.Priority p, Object message, Throwable t)
          Deprecated. Use Level versions.
 void trace(Object message)
          Issue a log msg with a level of TRACE.
 void trace(Object message, Throwable t)
          Issue a log msg and throwable with a level of TRACE.
 void trace(String loggerFcqn, Object message, Throwable t)
          
 void warn(Object message)
          Issue a log msg with a level of WARN.
 void warn(Object message, Throwable t)
          Issue a log msg and throwable with a level of WARN.
 void warn(String loggerFcqn, Object message, Throwable t)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4jLoggerPlugin

public Log4jLoggerPlugin()
Method Detail

init

public void init(String name)
Specified by:
init in interface org.jboss.logging.LoggerPlugin

getCategory

public org.apache.log4j.Category getCategory()

getLogger

public org.apache.log4j.Logger getLogger()
Exposes the delegate Log4j Logger.

Returns:
the underlying logger

isTraceEnabled

public boolean isTraceEnabled()
Specified by:
isTraceEnabled in interface org.jboss.logging.LoggerPlugin

trace

public void trace(Object message)
Issue a log msg with a level of TRACE. Invokes log.log(Level.TRACE, message);

Specified by:
trace in interface org.jboss.logging.LoggerPlugin

trace

public void trace(Object message,
                  Throwable t)
Issue a log msg and throwable with a level of TRACE. Invokes log.log(Level.TRACE, message, t);

Specified by:
trace in interface org.jboss.logging.LoggerPlugin

trace

public void trace(String loggerFcqn,
                  Object message,
                  Throwable t)


isDebugEnabled

@Deprecated
public boolean isDebugEnabled()
Deprecated. 

Check to see if the TRACE level is enabled for this logger.

Specified by:
isDebugEnabled in interface org.jboss.logging.LoggerPlugin
Returns:
true if a trace(Object) method invocation would pass the msg to the configured appenders, false otherwise.

debug

public void debug(Object message)
Issue a log msg with a level of DEBUG. Invokes log.log(Level.DEBUG, message);

Specified by:
debug in interface org.jboss.logging.LoggerPlugin

debug

public void debug(Object message,
                  Throwable t)
Issue a log msg and throwable with a level of DEBUG. Invokes log.log(Level.DEBUG, message, t);

Specified by:
debug in interface org.jboss.logging.LoggerPlugin

debug

public void debug(String loggerFcqn,
                  Object message,
                  Throwable t)


isInfoEnabled

@Deprecated
public boolean isInfoEnabled()
Deprecated. 

Check to see if the INFO level is enabled for this logger.

Specified by:
isInfoEnabled in interface org.jboss.logging.LoggerPlugin
Returns:
true if a info(Object) method invocation would pass the msg to the configured appenders, false otherwise.

info

public void info(Object message)
Issue a log msg with a level of INFO. Invokes log.log(Level.INFO, message);

Specified by:
info in interface org.jboss.logging.LoggerPlugin

info

public void info(Object message,
                 Throwable t)
Issue a log msg and throwable with a level of INFO. Invokes log.log(Level.INFO, message, t);

Specified by:
info in interface org.jboss.logging.LoggerPlugin

info

public void info(String loggerFcqn,
                 Object message,
                 Throwable t)


warn

public void warn(Object message)
Issue a log msg with a level of WARN. Invokes log.log(Level.WARN, message);

Specified by:
warn in interface org.jboss.logging.LoggerPlugin

warn

public void warn(Object message,
                 Throwable t)
Issue a log msg and throwable with a level of WARN. Invokes log.log(Level.WARN, message, t);

Specified by:
warn in interface org.jboss.logging.LoggerPlugin

warn

public void warn(String loggerFcqn,
                 Object message,
                 Throwable t)


error

public void error(Object message)
Issue a log msg with a level of ERROR. Invokes log.log(Level.ERROR, message);

Specified by:
error in interface org.jboss.logging.LoggerPlugin

error

public void error(Object message,
                  Throwable t)
Issue a log msg and throwable with a level of ERROR. Invokes log.log(Level.ERROR, message, t);

Specified by:
error in interface org.jboss.logging.LoggerPlugin

error

public void error(String loggerFcqn,
                  Object message,
                  Throwable t)


fatal

public void fatal(Object message)
Issue a log msg with a level of FATAL. Invokes log.log(Level.FATAL, message);

Specified by:
fatal in interface org.jboss.logging.LoggerPlugin

fatal

public void fatal(Object message,
                  Throwable t)
Issue a log msg and throwable with a level of FATAL. Invokes log.log(Level.FATAL, message, t);

Specified by:
fatal in interface org.jboss.logging.LoggerPlugin

fatal

public void fatal(String loggerFcqn,
                  Object message,
                  Throwable t)


log

public void log(org.apache.log4j.Priority p,
                Object message)
Deprecated. Use Level versions.

Issue a log msg with the given level. Invokes log.log(p, message);

Parameters:
p - the priority
message - the message

log

public void log(org.apache.log4j.Priority p,
                Object message,
                Throwable t)
Deprecated. Use Level versions.

Issue a log msg with the given priority. Invokes log.log(p, message, t);

Parameters:
p - the priority
message - the message
t - the throwable

log

public void log(org.apache.log4j.Level l,
                Object message)
Issue a log msg with the given level. Invokes log.log(l, message);

Parameters:
l - the level
message - the message

log

public void log(org.apache.log4j.Level l,
                Object message,
                Throwable t)
Issue a log msg with the given level. Invokes log.log(l, message, t);

Parameters:
l - the level
message - the message
t - the throwable

getNDCProvider

public org.jboss.logging.NDCProvider getNDCProvider()
Specified by:
getNDCProvider in interface org.jboss.logging.NDCSupport

getMDCProvider

public org.jboss.logging.MDCProvider getMDCProvider()
Specified by:
getMDCProvider in interface org.jboss.logging.MDCSupport


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.