Getting a Response header into the logback logs

Crawford, Jeffrey jcrawford at
Tue Jan 26 01:32:22 UTC 2021

From: users <users-bounces at> on behalf of Cantor, Scott <cantor.2 at>
Sent: Monday, January 25, 2021 3:53 PM
To: Shib Users <users at>
Subject: Re: Getting a Response header into the logback logs

On 1/25/21, 5:44 PM, "users on behalf of Crawford, Jeffrey" <users-bounces at on behalf of jcrawford at> wrote:

>    We need to print the content of an "X-Request-ID" header into our shibboleth logs it doesn't seem like the encoder
> supports the %header{key} pattern, What would be the best way to print the content of that header in the logback logs in
> logback.xml

I don't think you could convert the PatternLayoutEncoder class in the appender into the logback-access version but the worst that can happen is it breaks so I guess it's a possibility.

Otherwise you'd have to write a Java filter to add to the MDC.

Forgive the probably silly question but where would be an appropriate way to add this? Assuming that we don't want to update the base code. More like a deployer type hook, feel free to point me to documentation

Jeffrey C.

-- Scott

For Consortium Member technical support, see
To unsubscribe from this list send an email to users-unsubscribe at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list