Logging API request headers

Showing results for 
Search instead for 
Did you mean: 
Member II

Logging API request headers


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?


Kind regards,

1 Reply

Re: Logging API request headers

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.