messgeLogging : How to pass error.content to messgeLogging policy

Not applicable

Hi

I am trying to pass error.content to messge Logging policy . I am getting below error from proxy and its assigned to error.content defuault variable . But I am not able to get this value to message Logging policy which I have placed in postClientFlow.

error.content {"status": "error", "error": {"message": "Spike arrest violation" }}

1)How can i get error.content to Message logging policy if in case of any error with in proxy ?

2)Also is how I can pass the response (positive response or error message ) from target to messge Logging policy ?

0 2 751
2 REPLIES 2

@Shanish kp have you looked at the docs here on how to set these variables : https://docs.apigee.com/api-services/reference/variables-reference#messagevariables

If you posted more details of how you actually implemented the policy we might be able to give you a better answer.

@shanish kp

You can try the error.status.code and error.reason.phrase these two error variables give you the HTTP status code associated with the error and reason phrase associated with the error.

For more details about flow variables and error variables you can refer docs here :

https://docs.apigee.com/api-services/reference/variables-reference#errorvariables