Getting a Response header into the logback logs

Cantor, Scott cantor.2 at
Mon Jan 25 23:53:54 UTC 2021

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.

-- Scott

More information about the users mailing list