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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle
org.apache.catalina.Lifecycle.SingleUse -
Field Summary
FieldsFields inherited from class org.apache.catalina.valves.ValveBase
asyncSupported, container, containerLog, nextFields inherited from interface org.apache.catalina.Lifecycle
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAppender(ch.qos.logback.core.Appender<IAccessEvent> newAppender) voidaddConfigurationEventListener(ch.qos.logback.core.spi.ConfigurationEventListener listener) voidvoidaddFilter(ch.qos.logback.core.filter.Filter<IAccessEvent> newFilter) voidvoidaddLifecycleListener(org.apache.catalina.LifecycleListener arg0) voidaddScheduledFuture(ScheduledFuture<?> scheduledFuture) voidaddStatus(ch.qos.logback.core.status.Status status) voidaddSubstitutionProperty(String key, String value) voidvoidvoidbooleandetachAppender(ch.qos.logback.core.Appender<IAccessEvent> appender) booleandetachAppender(String name) org.apache.catalina.LifecycleListener[]voidfireConfigurationEvent(ch.qos.logback.core.spi.ConfigurationEvent configurationEvent) ch.qos.logback.core.Appender<IAccessEvent> getAppender(String name) longList<ch.qos.logback.core.filter.Filter<IAccessEvent>> ch.qos.logback.core.spi.FilterReplygetInfo()getName()getProperty(String key) ch.qos.logback.core.spi.SequenceNumberGeneratorch.qos.logback.core.status.StatusManagervoidinvoke(org.apache.catalina.connector.Request request, org.apache.catalina.connector.Response response) booleanisAttached(ch.qos.logback.core.Appender<IAccessEvent> appender) booleanisQuiet()booleanIterator<ch.qos.logback.core.Appender<IAccessEvent>> voidvoidputProperty(String key, String val) voidregister(ch.qos.logback.core.spi.LifeCycle component) voidremoveLifecycleListener(org.apache.catalina.LifecycleListener arg0) voidsetFilename(String filename) voidvoidsetQuiet(boolean quiet) voidsetSequenceNumberGenerator(ch.qos.logback.core.spi.SequenceNumberGenerator sequenceNumberGenerator) voidprotected voidtoString()Methods inherited from class org.apache.catalina.valves.ValveBase
backgroundProcess, getContainer, getDomainInternal, getNext, getObjectNameKeyProperties, initInternal, isAsyncSupported, setAsyncSupported, setContainer, setNextMethods inherited from class org.apache.catalina.util.LifecycleMBeanBase
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregisterMethods inherited from class org.apache.catalina.util.LifecycleBase
destroy, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, setState, setState, setThrowOnFailure, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.qos.logback.core.Context
getAlternateExecutorService, removeConfigurationEventListenerMethods inherited from interface org.apache.catalina.Lifecycle
destroy, getState, getStateName, init, start, stopMethods inherited from interface ch.qos.logback.core.spi.PropertyContainer
addSubstitutionProperties
-
Field Details
-
DEFAULT_FILENAME
- See Also:
-
DEFAULT_CONFIG_FILE
-
-
Constructor Details
-
LogbackValve
public LogbackValve()
-
-
Method Details
-
isStarted
public boolean isStarted() -
startInternal
public void startInternal() throws org.apache.catalina.LifecycleException- Overrides:
startInternalin classorg.apache.catalina.valves.ValveBase- Throws:
org.apache.catalina.LifecycleException
-
addStatus
public void addStatus(ch.qos.logback.core.status.Status status) -
addInfo
-
addWarn
-
addError
-
getFilename
-
setFilename
-
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:
invokein interfaceorg.apache.catalina.Valve- Throws:
IOExceptionjakarta.servlet.ServletException
-
stopInternal
protected void stopInternal() throws org.apache.catalina.LifecycleException- Overrides:
stopInternalin classorg.apache.catalina.valves.ValveBase- Throws:
org.apache.catalina.LifecycleException
-
addAppender
- Specified by:
addAppenderin interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
iteratorForAppenders
- Specified by:
iteratorForAppendersin interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
getAppender
- Specified by:
getAppenderin interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
isAttached
- Specified by:
isAttachedin interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
detachAndStopAllAppenders
public void detachAndStopAllAppenders()- Specified by:
detachAndStopAllAppendersin interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
detachAppender
- Specified by:
detachAppenderin interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
detachAppender
- Specified by:
detachAppenderin interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
getInfo
-
getStatusManager
public ch.qos.logback.core.status.StatusManager getStatusManager()- Specified by:
getStatusManagerin interfacech.qos.logback.core.Context
-
getPropertyMap
-
addSubstitutionProperty
- Specified by:
addSubstitutionPropertyin interfacech.qos.logback.core.spi.PropertyContainer
-
putProperty
- Specified by:
putPropertyin interfacech.qos.logback.core.Context
-
getProperty
- Specified by:
getPropertyin interfacech.qos.logback.core.Context- Specified by:
getPropertyin interfacech.qos.logback.core.spi.PropertyContainer
-
getCopyOfPropertyMap
- Specified by:
getCopyOfPropertyMapin interfacech.qos.logback.core.Context- Specified by:
getCopyOfPropertyMapin interfacech.qos.logback.core.spi.PropertyContainer
-
getObject
- Specified by:
getObjectin interfacech.qos.logback.core.Context
-
putObject
- Specified by:
putObjectin interfacech.qos.logback.core.Context
-
addFilter
- Specified by:
addFilterin interfacech.qos.logback.core.spi.FilterAttachable<IAccessEvent>
-
clearAllFilters
public void clearAllFilters()- Specified by:
clearAllFiltersin interfacech.qos.logback.core.spi.FilterAttachable<IAccessEvent>
-
getCopyOfAttachedFiltersList
- Specified by:
getCopyOfAttachedFiltersListin interfacech.qos.logback.core.spi.FilterAttachable<IAccessEvent>
-
getFilterChainDecision
- Specified by:
getFilterChainDecisionin interfacech.qos.logback.core.spi.FilterAttachable<IAccessEvent>
-
getExecutorService
- Specified by:
getExecutorServicein interfacech.qos.logback.core.Context
-
getName
- Specified by:
getNamein interfacech.qos.logback.core.Context
-
setName
- Specified by:
setNamein interfacech.qos.logback.core.Context
-
getBirthTime
public long getBirthTime()- Specified by:
getBirthTimein interfacech.qos.logback.core.Context
-
getConfigurationLock
- Specified by:
getConfigurationLockin interfacech.qos.logback.core.Context
-
register
public void register(ch.qos.logback.core.spi.LifeCycle component) - Specified by:
registerin interfacech.qos.logback.core.Context
-
addLifecycleListener
public void addLifecycleListener(org.apache.catalina.LifecycleListener arg0) - Specified by:
addLifecycleListenerin interfaceorg.apache.catalina.Lifecycle- Overrides:
addLifecycleListenerin classorg.apache.catalina.util.LifecycleBase
-
findLifecycleListeners
public org.apache.catalina.LifecycleListener[] findLifecycleListeners()- Specified by:
findLifecycleListenersin interfaceorg.apache.catalina.Lifecycle- Overrides:
findLifecycleListenersin classorg.apache.catalina.util.LifecycleBase
-
removeLifecycleListener
public void removeLifecycleListener(org.apache.catalina.LifecycleListener arg0) - Specified by:
removeLifecycleListenerin interfaceorg.apache.catalina.Lifecycle- Overrides:
removeLifecycleListenerin classorg.apache.catalina.util.LifecycleBase
-
toString
- Overrides:
toStringin classorg.apache.catalina.valves.ValveBase
-
getScheduledExecutorService
- Specified by:
getScheduledExecutorServicein interfacech.qos.logback.core.Context
-
addScheduledFuture
- Specified by:
addScheduledFuturein interfacech.qos.logback.core.Context
-
getSequenceNumberGenerator
public ch.qos.logback.core.spi.SequenceNumberGenerator getSequenceNumberGenerator()- Specified by:
getSequenceNumberGeneratorin interfacech.qos.logback.core.Context
-
setSequenceNumberGenerator
public void setSequenceNumberGenerator(ch.qos.logback.core.spi.SequenceNumberGenerator sequenceNumberGenerator) - Specified by:
setSequenceNumberGeneratorin interfacech.qos.logback.core.Context
-
addConfigurationEventListener
public void addConfigurationEventListener(ch.qos.logback.core.spi.ConfigurationEventListener listener) - Specified by:
addConfigurationEventListenerin interfacech.qos.logback.core.Context
-
fireConfigurationEvent
public void fireConfigurationEvent(ch.qos.logback.core.spi.ConfigurationEvent configurationEvent) - Specified by:
fireConfigurationEventin interfacech.qos.logback.core.Context
-