2022-11-19

How to log request headers within script mediator in Wso2 API Manager 3.2?

I am trying to get all transport headers used when calling a specific API and log that for debugging, since we do not know what the name of the headers will be I want to log them all.

I know this can be done via a class mediator as well as by enabling wire logs but I am looking for an option to achieve this without having to do either of those.

I have tried using script mediator and then using: mc.getProperty("org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS") to fetch them from message context but it just returns null.

Any suggestions?



No comments:

Post a Comment