Module ch.qos.logback.classic
Class CallerInstructionLogic
- java.lang.Object
-
- ch.qos.logback.classic.model.processor.CallerInstructionLogic
-
public class CallerInstructionLogic extends Object
Detects contradictory caller-data extraction instructions across appenders.During configuration analysis, each appender is associated with an
CallerInstructionLogic.Instructiondescribing whether it wants caller data extracted and how. This class checks a map of appender name to instruction for combinations that cannot work together at runtime and returns the correspondingStatusmessages.Compatibility rules:
CallerInstructionLogic.Instruction.DIRECT_WANTmay appear alone.CallerInstructionLogic.Instruction.PREPROCESS_WANTmay coexist withCallerInstructionLogic.Instruction.DIRECT_WANT.CallerInstructionLogic.Instruction.DO_NOT_WANTmust not coexist withCallerInstructionLogic.Instruction.PREPROCESS_WANT.CallerInstructionLogic.Instruction.DO_NOT_WANTmust not coexist withCallerInstructionLogic.Instruction.DIRECT_WANT.CallerInstructionLogic.Instruction.PREPROCESS_WANTalone is not a valid configuration.
- Since:
- 1.6.2
- See Also:
CallerContradictionAnalyser,CallerContradictionWarnAnalyser
-
-
Constructor Summary
Constructors Constructor Description CallerInstructionLogic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Status>contradiction(Map<String,ch.qos.logback.classic.model.processor.CallerInstructionLogic.Instruction> appenderNameToInstructionMap)Checks the given appender instructions for contradictions.
-
-
-
Constructor Detail
-
CallerInstructionLogic
public CallerInstructionLogic()
-
-
Method Detail
-
contradiction
public List<Status> contradiction(Map<String,ch.qos.logback.classic.model.processor.CallerInstructionLogic.Instruction> appenderNameToInstructionMap)
Checks the given appender instructions for contradictions.The map maps appender names to the caller-inclusion instruction gathered during analysis of the configuration model. Contradictions are reported as
WarnStatusentries; if none are found, a singleInfoStatusis returned. When one or more contradiction warnings are produced, an additional warning pointing toCALLER_CONTRADICTION_URLis appended.- Parameters:
appenderNameToInstructionMap- map of appender name to itsCallerInstructionLogic.Instruction; must not benull- Returns:
- a non-empty list of status objects describing the outcome of the contradiction check
-
-