org.apache.logging.log4j.spi
Class ExtendedLoggerWrapper

java.lang.Object
  extended by org.apache.logging.log4j.spi.AbstractLogger
      extended by org.apache.logging.log4j.spi.ExtendedLoggerWrapper
All Implemented Interfaces:
Serializable, Logger, ExtendedLogger

public class ExtendedLoggerWrapper
extends AbstractLogger

Wrapper class that exposes the protected AbstractLogger methods to support wrapped loggers.

See Also:
Serialized Form

Field Summary
protected  ExtendedLogger logger
          The wrapped Logger.
 
Fields inherited from class org.apache.logging.log4j.spi.AbstractLogger
CATCHING_MARKER, DEFAULT_MESSAGE_FACTORY_CLASS, ENTRY_MARKER, EXCEPTION_MARKER, EXIT_MARKER, FLOW_MARKER, THROWING_MARKER
 
Constructor Summary
ExtendedLoggerWrapper(ExtendedLogger logger, String name, MessageFactory messageFactory)
          Constructor that wraps and existing Logger.
 
Method Summary
 Level getLevel()
          Gets the Level associated with the Logger.
 boolean isEnabled(Level level, Marker marker, Message message, Throwable t)
          Detect if the event would be logged.
 boolean isEnabled(Level level, Marker marker, Object message, Throwable t)
          Detect if the event would be logged.
 boolean isEnabled(Level level, Marker marker, String message)
          Detect if the event would be logged.
 boolean isEnabled(Level level, Marker marker, String message, Object... params)
          Detect if the event would be logged.
 boolean isEnabled(Level level, Marker marker, String message, Throwable t)
          Detect if the event would be logged.
 void logMessage(String fqcn, Level level, Marker marker, Message message, Throwable t)
          Always log an event.
 
Methods inherited from class org.apache.logging.log4j.spi.AbstractLogger
catching, catching, catching, catchingMsg, checkMessageFactory, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, entry, entry, entry, entryMsg, error, error, error, error, error, error, error, error, error, error, error, error, error, error, exit, exit, exit, exitMsg, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, getMessageFactory, getName, info, info, info, info, info, info, info, info, info, info, info, info, info, info, isDebugEnabled, isDebugEnabled, isEnabled, isEnabled, isErrorEnabled, isErrorEnabled, isFatalEnabled, isFatalEnabled, isInfoEnabled, isInfoEnabled, isTraceEnabled, isTraceEnabled, isWarnEnabled, isWarnEnabled, log, log, log, log, log, log, log, log, log, log, log, log, log, log, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logMessage, logMessage, logMessage, logMessage, printf, printf, throwing, throwing, throwing, throwingMsg, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final ExtendedLogger logger
The wrapped Logger.

Constructor Detail

ExtendedLoggerWrapper

public ExtendedLoggerWrapper(ExtendedLogger logger,
                             String name,
                             MessageFactory messageFactory)
Constructor that wraps and existing Logger.

Parameters:
logger - The Logger to wrap.
name - The name of the Logger.
messageFactory - TODO
Method Detail

getLevel

public Level getLevel()
Description copied from interface: Logger
Gets the Level associated with the Logger.

Returns:
the Level associate with the Logger.

isEnabled

public boolean isEnabled(Level level,
                         Marker marker,
                         Message message,
                         Throwable t)
Detect if the event would be logged.

Parameters:
level - The logging Level to check.
marker - A Marker or null.
message - The Message.
t - A Throwable.
Returns:
true if the event would be logged for the Level, Marker, Message and Throwable, false otherwise.

isEnabled

public boolean isEnabled(Level level,
                         Marker marker,
                         Object message,
                         Throwable t)
Detect if the event would be logged.

Parameters:
level - The logging Level to check.
marker - A Marker or null.
message - The message.
t - A Throwable.
Returns:
true if the event would be logged for the Level, Marker, Object and Throwable, false otherwise.

isEnabled

public boolean isEnabled(Level level,
                         Marker marker,
                         String message)
Detect if the event would be logged.

Parameters:
level - The logging Level to check.
marker - A Marker or null.
message - The message.
Returns:
true if the event would be logged for the Level, Marker, message and parameter.

isEnabled

public boolean isEnabled(Level level,
                         Marker marker,
                         String message,
                         Object... params)
Detect if the event would be logged.

Parameters:
level - The logging Level to check.
marker - A Marker or null.
message - The message.
params - The parameters.
Returns:
true if the event would be logged for the Level, Marker, message and parameter.

isEnabled

public boolean isEnabled(Level level,
                         Marker marker,
                         String message,
                         Throwable t)
Detect if the event would be logged.

Parameters:
level - The logging Level to check.
marker - A Marker or null.
message - The message.
t - A Throwable.
Returns:
true if the event would be logged for the Level, Marker, message and Throwable, false otherwise.

logMessage

public void logMessage(String fqcn,
                       Level level,
                       Marker marker,
                       Message message,
                       Throwable t)
Always log an event. This tends to be already guarded by an enabled check, so this method should not check for the logger level again

Parameters:
fqcn - The fully qualified class name of the caller
level - The logging level
marker - The Marker
message - The Message.
t - A Throwable or null.


Copyright © 1999-2015 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.