Module ch.qos.logback.classic
Class CallerContradictionWarnAnalyser
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.model.processor.ModelHandlerBase
-
- ch.qos.logback.classic.model.processor.CallerContradictionWarnAnalyser
-
- All Implemented Interfaces:
ContextAware
public class CallerContradictionWarnAnalyser extends ModelHandlerBase
Dependency-analysis handler forConfigurationModelthat warns when a configuration contains contradictory caller-data instructions, for example anAsyncAppender,SocketAppenderorSMTPAppenderwithincludeCallerData=false(the default) alongside an appender (or SMTP layout) whose pattern uses a caller-data converter (%C,%M,%L,%F,%l,%class,%method,%line,%file,%caller).All work is done in
postHandle(ch.qos.logback.core.model.processor.ModelInterpretationContext, ch.qos.logback.core.model.Model)so that it runs after every childAppenderModelhas been visited byCallerContradictionAnalyser, regardless of declaration order.Analysis is skipped when the variable "logback.skipCallerContradictionAnalysis" is set to
true.- Since:
- 1.6.2
- See Also:
CallerContradictionAnalyser
-
-
Field Summary
-
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
-
Constructor Summary
Constructors Constructor Description CallerContradictionWarnAnalyser(Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class<ConfigurationModel>getSupportedModelClass()Subclasses should return the subclass of Model that they expect to handle.voidhandle(ModelInterpretationContext mic, Model model)voidpostHandle(ModelInterpretationContext mic, Model model)-
Methods inherited from class ch.qos.logback.core.model.processor.ModelHandlerBase
isSupportedModelType, toString
-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
-
-
-
Constructor Detail
-
CallerContradictionWarnAnalyser
public CallerContradictionWarnAnalyser(Context context)
-
-
Method Detail
-
getSupportedModelClass
protected Class<ConfigurationModel> getSupportedModelClass()
Description copied from class:ModelHandlerBaseSubclasses should return the subclass of Model that they expect to handle. The default implementation assumes that all Model classes are supported. This a very lax assumption which is usually not true.- Overrides:
getSupportedModelClassin classModelHandlerBase- Returns:
- supported model class
- See Also:
ModelHandlerBase.isSupportedModelType(Model)
-
handle
public void handle(ModelInterpretationContext mic, Model model) throws ModelHandlerException
- Specified by:
handlein classModelHandlerBase- Throws:
ModelHandlerException
-
postHandle
public void postHandle(ModelInterpretationContext mic, Model model) throws ModelHandlerException
- Overrides:
postHandlein classModelHandlerBase- Throws:
ModelHandlerException
-
-