Class WrappingLogger

  • Direct Known Subclasses:
    DebugLogger, NameWrappingLogger

    public class WrappingLogger
    extends Logger
    This logger wraps a normal logger and handles setting the log level appropriately. This allows for easy wrapping and extending a logger.
    This logger may have a different name than the wrapped logger.

    Logging is only forwarded to the wrapped logger in case this logs for the level of the current record. Otherwise logging is done by this logger.

    Author:
    Ulrich Kreher
    • Field Detail

      • innerLogger

        protected final Logger innerLogger
        The wrapped logger.
    • Constructor Detail

      • WrappingLogger

        protected WrappingLogger​(Logger innerLogger)
        Creates a new logger wrapping the designated one. The created logger will have the same name as the wrapped logger.
        Parameters:
        innerLogger - The logger to which all requests will be forwarded.
      • WrappingLogger

        protected WrappingLogger​(String name,
                                 Logger innerLogger)
        Creates a new logger wrapping the designated one and having the designated name.
        Parameters:
        innerLogger - The logger to which all requests will be forwarded.
        name - The name of the logger (this). This name is used in log records.