Class CallerInstructionLogic


  • public class CallerInstructionLogic
    extends Object
    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_WANT may appear alone.
    • CallerInstructionLogic.Instruction.PREPROCESS_WANT may coexist with CallerInstructionLogic.Instruction.DIRECT_WANT.
    • CallerInstructionLogic.Instruction.DO_NOT_WANT must not coexist with CallerInstructionLogic.Instruction.PREPROCESS_WANT.
    • CallerInstructionLogic.Instruction.DO_NOT_WANT must not coexist with CallerInstructionLogic.Instruction.DIRECT_WANT.
    • CallerInstructionLogic.Instruction.PREPROCESS_WANT alone is not a valid configuration.
    Since:
    1.6.2
    See Also:
    CallerContradictionAnalyser, CallerContradictionWarnAnalyser
    • 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 WarnStatus entries; if none are found, a single InfoStatus is returned. When one or more contradiction warnings are produced, an additional warning pointing to CALLER_CONTRADICTION_URL is appended.

        Parameters:
        appenderNameToInstructionMap - map of appender name to its CallerInstructionLogic.Instruction; must not be null
        Returns:
        a non-empty list of status objects describing the outcome of the contradiction check