org.springframework.boot.logging.logback

Class LevelRemappingAppender

  • java.lang.Object
    • ch.qos.logback.core.spi.ContextAwareBase
      • ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
        • org.springframework.boot.logging.logback.LevelRemappingAppender
  • All Implemented Interfaces:
    ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent>, ch.qos.logback.core.spi.ContextAware, ch.qos.logback.core.spi.FilterAttachable<ch.qos.logback.classic.spi.ILoggingEvent>, ch.qos.logback.core.spi.LifeCycle


    public class LevelRemappingAppender
    extends ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
    Appender that can remap ILoggingEvent Levels as they are written.
    Author:
    Phillip Webb
    See Also:
    setRemapLevels(String), setDestinationLogger(String)
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      protected static class  LevelRemappingAppender.AppendableLogger
      Simple wrapper around a logger that can have events appended.
    • Field Summary

      • Fields inherited from class ch.qos.logback.core.AppenderBase

        name, started
      • Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase

        context
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      protected void append(ch.qos.logback.classic.spi.ILoggingEvent event) 
      protected LevelRemappingAppender.AppendableLogger getLogger(String name) 
      void setDestinationLogger(String destinationLogger)
      Sets the destination logger that will be used to send remapped events.
      void setRemapLevels(String remapLevels)
      Set the remapped level.
      • Methods inherited from class ch.qos.logback.core.AppenderBase

        addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, start, stop, toString
      • Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase

        addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
      • Methods inherited from interface ch.qos.logback.core.spi.ContextAware

        addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
    • Constructor Detail

      • LevelRemappingAppender

        public LevelRemappingAppender()
    • Method Detail

      • append

        protected void append(ch.qos.logback.classic.spi.ILoggingEvent event)
        Specified by:
        append in class ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
      • setDestinationLogger

        public void setDestinationLogger(String destinationLogger)
        Sets the destination logger that will be used to send remapped events. If not specified the root logger is used.
        Parameters:
        destinationLogger - the destinationLogger name
      • setRemapLevels

        public void setRemapLevels(String remapLevels)
        Set the remapped level.
        Parameters:
        remapLevels - Comma separated String of remapped levels in the form "FROM->TO". For example, "DEBUG->TRACE,ERROR->WARN".

Copyright © 2015 Pivotal Software, Inc.. All rights reserved.