Class LogbackValve

java.lang.Object
org.apache.catalina.util.LifecycleBase
org.apache.catalina.util.LifecycleMBeanBase
org.apache.catalina.valves.ValveBase
ch.qos.logback.access.tomcat.LogbackValve
All Implemented Interfaces:
ch.qos.logback.core.Context, ch.qos.logback.core.spi.AppenderAttachable<IAccessEvent>, ch.qos.logback.core.spi.FilterAttachable<IAccessEvent>, ch.qos.logback.core.spi.PropertyContainer, MBeanRegistration, org.apache.catalina.Contained, org.apache.catalina.JmxEnabled, org.apache.catalina.Lifecycle, org.apache.catalina.Valve

public class LogbackValve extends org.apache.catalina.valves.ValveBase implements org.apache.catalina.Lifecycle, ch.qos.logback.core.Context, ch.qos.logback.core.spi.AppenderAttachable<IAccessEvent>, ch.qos.logback.core.spi.FilterAttachable<IAccessEvent>
This class is an implementation of tomcat's Valve interface, by extending ValveBase.

For more information on using LogbackValve please refer to the online documentation on logback-access and tomcat.

Author:
Ceki Gülcü, Sébastien Pennec
  • Field Details

  • Constructor Details

  • Method Details

    • isStarted

      public boolean isStarted()
    • startInternal

      public void startInternal() throws org.apache.catalina.LifecycleException
      Overrides:
      startInternal in class org.apache.catalina.valves.ValveBase
      Throws:
      org.apache.catalina.LifecycleException
    • addStatus

      public void addStatus(ch.qos.logback.core.status.Status status)
    • addInfo

      public void addInfo(String msg)
    • addWarn

      public void addWarn(String msg)
    • addError

      public void addError(String msg, Throwable t)
    • getFilename

      public String getFilename()
    • setFilename

      public void setFilename(String filename)
    • isQuiet

      public boolean isQuiet()
    • setQuiet

      public void setQuiet(boolean quiet)
    • invoke

      public void invoke(org.apache.catalina.connector.Request request, org.apache.catalina.connector.Response response) throws IOException, jakarta.servlet.ServletException
      Specified by:
      invoke in interface org.apache.catalina.Valve
      Throws:
      IOException
      jakarta.servlet.ServletException
    • stopInternal

      protected void stopInternal() throws org.apache.catalina.LifecycleException
      Overrides:
      stopInternal in class org.apache.catalina.valves.ValveBase
      Throws:
      org.apache.catalina.LifecycleException
    • addAppender

      public void addAppender(ch.qos.logback.core.Appender<IAccessEvent> newAppender)
      Specified by:
      addAppender in interface ch.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
    • iteratorForAppenders

      public Iterator<ch.qos.logback.core.Appender<IAccessEvent>> iteratorForAppenders()
      Specified by:
      iteratorForAppenders in interface ch.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
    • getAppender

      public ch.qos.logback.core.Appender<IAccessEvent> getAppender(String name)
      Specified by:
      getAppender in interface ch.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
    • isAttached

      public boolean isAttached(ch.qos.logback.core.Appender<IAccessEvent> appender)
      Specified by:
      isAttached in interface ch.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
    • detachAndStopAllAppenders

      Specified by:
      detachAndStopAllAppenders in interface ch.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
    • detachAppender

      public boolean detachAppender(ch.qos.logback.core.Appender<IAccessEvent> appender)
      Specified by:
      detachAppender in interface ch.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
    • detachAppender

      public boolean detachAppender(String name)
      Specified by:
      detachAppender in interface ch.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
    • getInfo

      public String getInfo()
    • getStatusManager

      public ch.qos.logback.core.status.StatusManager getStatusManager()
      Specified by:
      getStatusManager in interface ch.qos.logback.core.Context
    • getPropertyMap

    • addSubstitutionProperty

      public void addSubstitutionProperty(String key, String value)
      Specified by:
      addSubstitutionProperty in interface ch.qos.logback.core.spi.PropertyContainer
    • putProperty

      public void putProperty(String key, String val)
      Specified by:
      putProperty in interface ch.qos.logback.core.Context
    • getProperty

      public String getProperty(String key)
      Specified by:
      getProperty in interface ch.qos.logback.core.Context
      Specified by:
      getProperty in interface ch.qos.logback.core.spi.PropertyContainer
    • getCopyOfPropertyMap

      Specified by:
      getCopyOfPropertyMap in interface ch.qos.logback.core.Context
      Specified by:
      getCopyOfPropertyMap in interface ch.qos.logback.core.spi.PropertyContainer
    • getObject

      public Object getObject(String key)
      Specified by:
      getObject in interface ch.qos.logback.core.Context
    • putObject

      public void putObject(String key, Object value)
      Specified by:
      putObject in interface ch.qos.logback.core.Context
    • addFilter

      public void addFilter(ch.qos.logback.core.filter.Filter<IAccessEvent> newFilter)
      Specified by:
      addFilter in interface ch.qos.logback.core.spi.FilterAttachable<IAccessEvent>
    • clearAllFilters

      public void clearAllFilters()
      Specified by:
      clearAllFilters in interface ch.qos.logback.core.spi.FilterAttachable<IAccessEvent>
    • getCopyOfAttachedFiltersList

      public List<ch.qos.logback.core.filter.Filter<IAccessEvent>> getCopyOfAttachedFiltersList()
      Specified by:
      getCopyOfAttachedFiltersList in interface ch.qos.logback.core.spi.FilterAttachable<IAccessEvent>
    • getFilterChainDecision

      public ch.qos.logback.core.spi.FilterReply getFilterChainDecision(IAccessEvent event)
      Specified by:
      getFilterChainDecision in interface ch.qos.logback.core.spi.FilterAttachable<IAccessEvent>
    • getExecutorService

      Specified by:
      getExecutorService in interface ch.qos.logback.core.Context
    • getName

      public String getName()
      Specified by:
      getName in interface ch.qos.logback.core.Context
    • setName

      public void setName(String name)
      Specified by:
      setName in interface ch.qos.logback.core.Context
    • getBirthTime

      public long getBirthTime()
      Specified by:
      getBirthTime in interface ch.qos.logback.core.Context
    • getConfigurationLock

      Specified by:
      getConfigurationLock in interface ch.qos.logback.core.Context
    • register

      public void register(ch.qos.logback.core.spi.LifeCycle component)
      Specified by:
      register in interface ch.qos.logback.core.Context
    • addLifecycleListener

      public void addLifecycleListener(org.apache.catalina.LifecycleListener arg0)
      Specified by:
      addLifecycleListener in interface org.apache.catalina.Lifecycle
      Overrides:
      addLifecycleListener in class org.apache.catalina.util.LifecycleBase
    • findLifecycleListeners

      public org.apache.catalina.LifecycleListener[] findLifecycleListeners()
      Specified by:
      findLifecycleListeners in interface org.apache.catalina.Lifecycle
      Overrides:
      findLifecycleListeners in class org.apache.catalina.util.LifecycleBase
    • removeLifecycleListener

      public void removeLifecycleListener(org.apache.catalina.LifecycleListener arg0)
      Specified by:
      removeLifecycleListener in interface org.apache.catalina.Lifecycle
      Overrides:
      removeLifecycleListener in class org.apache.catalina.util.LifecycleBase
    • toString

      public String toString()
      Overrides:
      toString in class org.apache.catalina.valves.ValveBase
    • getScheduledExecutorService

      Specified by:
      getScheduledExecutorService in interface ch.qos.logback.core.Context
    • addScheduledFuture

      public void addScheduledFuture(ScheduledFuture<?> scheduledFuture)
      Specified by:
      addScheduledFuture in interface ch.qos.logback.core.Context
    • getSequenceNumberGenerator

      public ch.qos.logback.core.spi.SequenceNumberGenerator getSequenceNumberGenerator()
      Specified by:
      getSequenceNumberGenerator in interface ch.qos.logback.core.Context
    • setSequenceNumberGenerator

      public void setSequenceNumberGenerator(ch.qos.logback.core.spi.SequenceNumberGenerator sequenceNumberGenerator)
      Specified by:
      setSequenceNumberGenerator in interface ch.qos.logback.core.Context
    • addConfigurationEventListener

      public void addConfigurationEventListener(ch.qos.logback.core.spi.ConfigurationEventListener listener)
      Specified by:
      addConfigurationEventListener in interface ch.qos.logback.core.Context
    • fireConfigurationEvent

      public void fireConfigurationEvent(ch.qos.logback.core.spi.ConfigurationEvent configurationEvent)
      Specified by:
      fireConfigurationEvent in interface ch.qos.logback.core.Context