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
Fields inherited from class org.apache.catalina.valves.ValveBase
asyncSupported, container, containerLog, next
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAppender
(ch.qos.logback.core.Appender<IAccessEvent> newAppender) void
addConfigurationEventListener
(ch.qos.logback.core.spi.ConfigurationEventListener listener) void
void
addFilter
(ch.qos.logback.core.filter.Filter<IAccessEvent> newFilter) void
void
addLifecycleListener
(org.apache.catalina.LifecycleListener arg0) void
addScheduledFuture
(ScheduledFuture<?> scheduledFuture) void
addStatus
(ch.qos.logback.core.status.Status status) void
addSubstitutionProperty
(String key, String value) void
void
void
boolean
detachAppender
(ch.qos.logback.core.Appender<IAccessEvent> appender) boolean
detachAppender
(String name) org.apache.catalina.LifecycleListener[]
void
fireConfigurationEvent
(ch.qos.logback.core.spi.ConfigurationEvent configurationEvent) ch.qos.logback.core.Appender
<IAccessEvent> getAppender
(String name) long
List
<ch.qos.logback.core.filter.Filter<IAccessEvent>> ch.qos.logback.core.spi.FilterReply
getInfo()
getName()
getProperty
(String key) ch.qos.logback.core.spi.SequenceNumberGenerator
ch.qos.logback.core.status.StatusManager
void
invoke
(org.apache.catalina.connector.Request request, org.apache.catalina.connector.Response response) boolean
isAttached
(ch.qos.logback.core.Appender<IAccessEvent> appender) boolean
isQuiet()
boolean
Iterator
<ch.qos.logback.core.Appender<IAccessEvent>> void
void
putProperty
(String key, String val) void
register
(ch.qos.logback.core.spi.LifeCycle component) void
removeLifecycleListener
(org.apache.catalina.LifecycleListener arg0) void
setFilename
(String filename) void
void
setQuiet
(boolean quiet) void
setSequenceNumberGenerator
(ch.qos.logback.core.spi.SequenceNumberGenerator sequenceNumberGenerator) void
protected void
toString()
Methods inherited from class org.apache.catalina.valves.ValveBase
backgroundProcess, getContainer, getDomainInternal, getNext, getObjectNameKeyProperties, initInternal, isAsyncSupported, setAsyncSupported, setContainer, setNext
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregister
Methods inherited from class org.apache.catalina.util.LifecycleBase
destroy, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, setState, setState, setThrowOnFailure, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.qos.logback.core.Context
getAlternateExecutorService, removeConfigurationEventListener
Methods inherited from interface org.apache.catalina.Lifecycle
destroy, getState, getStateName, init, start, stop
Methods 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
-
startInternal
- Overrides:
startInternal
in classorg.apache.catalina.valves.ValveBase
- Throws:
org.apache.catalina.LifecycleException
-
addStatus
-
addInfo
-
addWarn
-
addError
-
getFilename
-
setFilename
-
isQuiet
-
setQuiet
-
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 interfaceorg.apache.catalina.Valve
- Throws:
IOException
jakarta.servlet.ServletException
-
stopInternal
- Overrides:
stopInternal
in classorg.apache.catalina.valves.ValveBase
- Throws:
org.apache.catalina.LifecycleException
-
addAppender
- Specified by:
addAppender
in interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
iteratorForAppenders
- Specified by:
iteratorForAppenders
in interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
getAppender
- Specified by:
getAppender
in interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
isAttached
- Specified by:
isAttached
in interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
detachAndStopAllAppenders
- Specified by:
detachAndStopAllAppenders
in interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
detachAppender
- Specified by:
detachAppender
in interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
detachAppender
- Specified by:
detachAppender
in interfacech.qos.logback.core.spi.AppenderAttachable<IAccessEvent>
-
getInfo
-
getStatusManager
- Specified by:
getStatusManager
in interfacech.qos.logback.core.Context
-
getPropertyMap
-
addSubstitutionProperty
- Specified by:
addSubstitutionProperty
in interfacech.qos.logback.core.spi.PropertyContainer
-
putProperty
- Specified by:
putProperty
in interfacech.qos.logback.core.Context
-
getProperty
- Specified by:
getProperty
in interfacech.qos.logback.core.Context
- Specified by:
getProperty
in interfacech.qos.logback.core.spi.PropertyContainer
-
getCopyOfPropertyMap
- Specified by:
getCopyOfPropertyMap
in interfacech.qos.logback.core.Context
- Specified by:
getCopyOfPropertyMap
in interfacech.qos.logback.core.spi.PropertyContainer
-
getObject
-
putObject
-
addFilter
- Specified by:
addFilter
in interfacech.qos.logback.core.spi.FilterAttachable<IAccessEvent>
-
clearAllFilters
- Specified by:
clearAllFilters
in interfacech.qos.logback.core.spi.FilterAttachable<IAccessEvent>
-
getCopyOfAttachedFiltersList
- Specified by:
getCopyOfAttachedFiltersList
in interfacech.qos.logback.core.spi.FilterAttachable<IAccessEvent>
-
getFilterChainDecision
- Specified by:
getFilterChainDecision
in interfacech.qos.logback.core.spi.FilterAttachable<IAccessEvent>
-
getExecutorService
- Specified by:
getExecutorService
in interfacech.qos.logback.core.Context
-
getName
-
setName
-
getBirthTime
- Specified by:
getBirthTime
in interfacech.qos.logback.core.Context
-
getConfigurationLock
- Specified by:
getConfigurationLock
in interfacech.qos.logback.core.Context
-
register
- Specified by:
register
in interfacech.qos.logback.core.Context
-
addLifecycleListener
- Specified by:
addLifecycleListener
in interfaceorg.apache.catalina.Lifecycle
- Overrides:
addLifecycleListener
in classorg.apache.catalina.util.LifecycleBase
-
findLifecycleListeners
- Specified by:
findLifecycleListeners
in interfaceorg.apache.catalina.Lifecycle
- Overrides:
findLifecycleListeners
in classorg.apache.catalina.util.LifecycleBase
-
removeLifecycleListener
- Specified by:
removeLifecycleListener
in interfaceorg.apache.catalina.Lifecycle
- Overrides:
removeLifecycleListener
in classorg.apache.catalina.util.LifecycleBase
-
toString
-
getScheduledExecutorService
- Specified by:
getScheduledExecutorService
in interfacech.qos.logback.core.Context
-
addScheduledFuture
- Specified by:
addScheduledFuture
in interfacech.qos.logback.core.Context
-
getSequenceNumberGenerator
- Specified by:
getSequenceNumberGenerator
in interfacech.qos.logback.core.Context
-
setSequenceNumberGenerator
public void setSequenceNumberGenerator(ch.qos.logback.core.spi.SequenceNumberGenerator sequenceNumberGenerator) - Specified by:
setSequenceNumberGenerator
in interfacech.qos.logback.core.Context
-
addConfigurationEventListener
public void addConfigurationEventListener(ch.qos.logback.core.spi.ConfigurationEventListener listener) - Specified by:
addConfigurationEventListener
in interfacech.qos.logback.core.Context
-
fireConfigurationEvent
- Specified by:
fireConfigurationEvent
in interfacech.qos.logback.core.Context
-