Class Log4j2Router


  • public class Log4j2Router
    extends NullTracer
    A specialized NullTracer which delegates log messages to Log4j2 loggers. For more information about Log4j2, see Apache Log4j.
    Author:
    Christof Reichardt
    • Constructor Detail

      • Log4j2Router

        public Log4j2Router()
    • Method Detail

      • logMessage

        public void logMessage​(LogLevel logLevel,
                               String message,
                               Class<?> clazz,
                               String methodName)
        This method gets itself a Log4j2 ExtendedLogger by invoking Log4j2s LogManager with the given clazz. Thereupon the ExtendedLogger will be used to log the given message.
        Overrides:
        logMessage in class NullTracer
        Parameters:
        logLevel - will be converted to Log4j2s level
        message - the to be logged message
        clazz - the originating class
        methodName - the originating method
      • logException

        public void logException​(LogLevel logLevel,
                                 Throwable throwable,
                                 Class<?> clazz,
                                 String methodName)
        This method gets itself a Log4j2 ExtendedLogger by invoking Log4j2s LogManager with the given clazz. Thereupon the ExtendedLogger will be used to log the given throwable.
        Overrides:
        logException in class NullTracer
        Parameters:
        logLevel - will be converted to Log4j2s level
        throwable - the to be logged throwable
        clazz - the originating class
        methodName - the name of the relevant method