Module ch.qos.logback.classic
Class CallerInstructionLogic
java.lang.Object
ch.qos.logback.classic.model.processor.CallerInstructionLogic
Detects contradictory caller-data extraction instructions across appenders.
During configuration analysis, each appender is associated with an
CallerInstructionLogic.Instruction describing 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
corresponding Status messages.
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontradiction(Map<String, ch.qos.logback.classic.model.processor.CallerInstructionLogic.Instruction> appenderNameToInstructionMap) Checks the given appender instructions for contradictions.
-
Constructor Details
-
CallerInstructionLogic
public CallerInstructionLogic()
-
-
Method Details
-
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
-