AnsweredAssumed Answered

Logging with Customize Error Response assertion

Question asked by tonysve on Mar 18, 2016
Latest reply on Nov 27, 2017 by Muthugomu



I need to be able to log info about a service's response after policy execution. Both successful and failed responses.


In the OTK policies for the Gateway, the usage of the Customize Error Response assertion is frequently used for handling errors.

Apparently the gateway only sets the response from whatever is specified in the Customize Error Response *after* execution of policies (including any global policy fragments).

So for example, when trying to refer to _response.http.status_ in a global policy fragment in the message-completed phase, the response is unavailable.

Seems that the response is never set until after that execution point. And I know it is set, because the client receives the "correct" error response.


Does anyone know a way to get hold of the response that is returned when an error occurs (policy falsified) and the Customize Error Response assertion is used?