cancel
Showing results for 
Search instead for 
Did you mean: 

Logging API request headers

lnedasco
Champ in-the-making
Champ in-the-making

Hello,

We have an application that uses tracking ids throughout multiple services. This id is also sent to Alfresco using headers.

We would like to log this id in some way. I searched the docs but could not find anything how to log (all) headers of the requests (e.g. when a node is added).

Is this possible, or is there some other way we could get this id to show up in the Alfresco logs?

Thanks.

Kind regards,
LNE

1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator

There is no default feature to map arbitrary HTTP headers into the logging context, but you could simply implement an extension with a WebFilter / ServletFilter to map your headers to the log4j MDC, and adapt the logging format via custom-log4j.properties to include those MDC variables.