Class Log4J2Logger

  • All Implemented Interfaces:
    InternalLogger, java.io.Serializable, org.apache.logging.log4j.Logger, org.apache.logging.log4j.spi.ExtendedLogger, org.apache.logging.log4j.spi.LocationAwareLogger

    class Log4J2Logger
    extends org.apache.logging.log4j.spi.ExtendedLoggerWrapper
    implements InternalLogger
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long serialVersionUID  
      private static boolean VARARGS_ONLY  
      • Fields inherited from class org.apache.logging.log4j.spi.ExtendedLoggerWrapper

        logger
      • Fields inherited from class org.apache.logging.log4j.spi.AbstractLogger

        CATCHING_MARKER, DEFAULT_FLOW_MESSAGE_FACTORY_CLASS, DEFAULT_MESSAGE_FACTORY_CLASS, ENTRY_MARKER, EXCEPTION_MARKER, EXIT_MARKER, FLOW_MARKER, logBuilder, name, THROWING_MARKER
    • Constructor Summary

      Constructors 
      Constructor Description
      Log4J2Logger​(org.apache.logging.log4j.Logger logger)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void debug​(java.lang.Throwable t)
      Log an exception (throwable) at the DEBUG level.
      void error​(java.lang.Throwable t)
      Log an exception (throwable) at the ERROR level.
      void info​(java.lang.Throwable t)
      Log an exception (throwable) at the INFO level.
      boolean isEnabled​(InternalLogLevel level)
      Is the logger instance enabled for the specified level?
      void log​(InternalLogLevel level, java.lang.String msg)
      Log a message at the specified level.
      void log​(InternalLogLevel level, java.lang.String format, java.lang.Object arg)
      Log a message at the specified level according to the specified format and argument.
      void log​(InternalLogLevel level, java.lang.String format, java.lang.Object... arguments)
      Log a message at the specified level according to the specified format and arguments.
      void log​(InternalLogLevel level, java.lang.String format, java.lang.Object argA, java.lang.Object argB)
      Log a message at the specified level according to the specified format and arguments.
      void log​(InternalLogLevel level, java.lang.String msg, java.lang.Throwable t)
      Log an exception (throwable) at the specified level with an accompanying message.
      void log​(InternalLogLevel level, java.lang.Throwable t)
      Log an exception (throwable) at the specified level.
      java.lang.String name()
      Return the name of this InternalLogger instance.
      private static org.apache.logging.log4j.Level toLevel​(InternalLogLevel level)  
      void trace​(java.lang.Throwable t)
      Log an exception (throwable) at the TRACE level.
      void warn​(java.lang.Throwable t)
      Log an exception (throwable) at the WARN level.
      • Methods inherited from class org.apache.logging.log4j.spi.ExtendedLoggerWrapper

        getLevel, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, logMessage
      • Methods inherited from class org.apache.logging.log4j.spi.AbstractLogger

        always, atDebug, atError, atFatal, atInfo, atLevel, atTrace, atWarn, catching, catching, catching, catchingMsg, checkMessageFactory, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, enter, enter, enter, enter, enter, entry, entry, entry, entryMsg, entryMsg, entryMsg, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, exit, exit, exit, exit, exitMsg, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, getMessageFactory, getName, getRecursionDepth, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, 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, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, printf, printf, requiresLocation, throwing, throwing, throwing, throwingMsg, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, traceEntry, traceEntry, traceEntry, traceEntry, traceEntry, traceExit, traceExit, traceExit, traceExit, traceExit, traceExit, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, 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

      • VARARGS_ONLY

        private static final boolean VARARGS_ONLY
    • Constructor Detail

      • Log4J2Logger

        Log4J2Logger​(org.apache.logging.log4j.Logger logger)
    • Method Detail

      • trace

        public void trace​(java.lang.Throwable t)
        Description copied from interface: InternalLogger
        Log an exception (throwable) at the TRACE level.
        Specified by:
        trace in interface InternalLogger
        Parameters:
        t - the exception (throwable) to log
      • debug

        public void debug​(java.lang.Throwable t)
        Description copied from interface: InternalLogger
        Log an exception (throwable) at the DEBUG level.
        Specified by:
        debug in interface InternalLogger
        Parameters:
        t - the exception (throwable) to log
      • info

        public void info​(java.lang.Throwable t)
        Description copied from interface: InternalLogger
        Log an exception (throwable) at the INFO level.
        Specified by:
        info in interface InternalLogger
        Parameters:
        t - the exception (throwable) to log
      • warn

        public void warn​(java.lang.Throwable t)
        Description copied from interface: InternalLogger
        Log an exception (throwable) at the WARN level.
        Specified by:
        warn in interface InternalLogger
        Parameters:
        t - the exception (throwable) to log
      • error

        public void error​(java.lang.Throwable t)
        Description copied from interface: InternalLogger
        Log an exception (throwable) at the ERROR level.
        Specified by:
        error in interface InternalLogger
        Parameters:
        t - the exception (throwable) to log
      • isEnabled

        public boolean isEnabled​(InternalLogLevel level)
        Description copied from interface: InternalLogger
        Is the logger instance enabled for the specified level?
        Specified by:
        isEnabled in interface InternalLogger
        Returns:
        True if this Logger is enabled for the specified level, false otherwise.
      • log

        public void log​(InternalLogLevel level,
                        java.lang.String msg)
        Description copied from interface: InternalLogger
        Log a message at the specified level.
        Specified by:
        log in interface InternalLogger
        msg - the message string to be logged
      • log

        public void log​(InternalLogLevel level,
                        java.lang.String format,
                        java.lang.Object arg)
        Description copied from interface: InternalLogger
        Log a message at the specified level according to the specified format and argument.

        This form avoids superfluous object creation when the logger is disabled for the specified level.

        Specified by:
        log in interface InternalLogger
        format - the format string
        arg - the argument
      • log

        public void log​(InternalLogLevel level,
                        java.lang.String format,
                        java.lang.Object argA,
                        java.lang.Object argB)
        Description copied from interface: InternalLogger
        Log a message at the specified level according to the specified format and arguments.

        This form avoids superfluous object creation when the logger is disabled for the specified level.

        Specified by:
        log in interface InternalLogger
        format - the format string
        argA - the first argument
        argB - the second argument
      • log

        public void log​(InternalLogLevel level,
                        java.lang.String format,
                        java.lang.Object... arguments)
        Description copied from interface: InternalLogger
        Log a message at the specified level according to the specified format and arguments.

        This form avoids superfluous string concatenation when the logger is disabled for the specified level. However, this variant incurs the hidden (and relatively small) cost of creating an Object[] before invoking the method, even if this logger is disabled for the specified level. The variants taking one and two arguments exist solely in order to avoid this hidden cost.

        Specified by:
        log in interface InternalLogger
        format - the format string
        arguments - a list of 3 or more arguments
      • log

        public void log​(InternalLogLevel level,
                        java.lang.String msg,
                        java.lang.Throwable t)
        Description copied from interface: InternalLogger
        Log an exception (throwable) at the specified level with an accompanying message.
        Specified by:
        log in interface InternalLogger
        msg - the message accompanying the exception
        t - the exception (throwable) to log
      • log

        public void log​(InternalLogLevel level,
                        java.lang.Throwable t)
        Description copied from interface: InternalLogger
        Log an exception (throwable) at the specified level.
        Specified by:
        log in interface InternalLogger
        t - the exception (throwable) to log
      • toLevel

        private static org.apache.logging.log4j.Level toLevel​(InternalLogLevel level)