Context Propagation

Overview

Verification of Payee (VoP) Requester has support for propagating the request messages Request ID into all log statements. This is achieved by leveraging Mapped Diagnostic Context (MDC).

Propagating the request id into log statements is enabled by default, but you would need to add the requestId into the logback.xml file to be able to see it in log statements. The VoP Responder app comes preloaded with a logback.xml file that has the requestId MDC key in it already.

The requestId value will be populated only once we are able to extract the requestId from the message, so in some cases it may appear empty.

However, below is an example of adding this to an appender pattern:

    <appender name="ConsoleAppender" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>
                %d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger{36} requestId=[%X{requestId}] - %msg%n
            </pattern>
        </encoder>
    </appender>

This would output a sample log line as follows, where the requestId in the message had value 12345:

26-06-2025 15:35:39.545 [main] INFO  c.i.i.p.v.h.VerificationOfPayeeRequesterHandler requestId=[12345] - This is a log line