Hi,
I'm trying to log response body using MessageLogging policy. As recommended here, we have our logging policy in PostClientFlow. Unfortunately, response body doesn't seem to be available in this flow. What's the optimal way to log response body? Thank you in advance!
Here's my logging policy
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <MessageLogging name="ErrorLogging" enabled="true" continueOnError="false" async="false"> <DisplayName>ErrorLogging</DisplayName> <File> <Message>{system.time}: {apiproxy.name}.{environment.name} Error Information: Apikey: {apigee.client_id} Message ID: {messageid} Consumer Application Name: {developer.app.name} Http Status Code: {message.status.code} Error Reason: {message.reason.phrase} Error Details: {error.message} Response Body: {response.content} </Message> <FileName>abc.log</FileName> <FileRotationOptions rotateFileOnStartup="true"> <FileRotationType>TIME</FileRotationType> <RotationFrequency unit="minute">1440</RotationFrequency> <MaxFilesToRetain>7</MaxFilesToRetain> </FileRotationOptions> </File> <logLevel>ERROR</logLevel> </MessageLogging>
Solved! Go to Solution.
A solution is outlined here: https://community.apigee.com/questions/18906/messagelogging-to-loggly.html
tl;dr -- put the respnose.content into a variable before you hit postclientflow and then use that variable instead of response.content in the messagelogging policy.
A solution is outlined here: https://community.apigee.com/questions/18906/messagelogging-to-loggly.html
tl;dr -- put the respnose.content into a variable before you hit postclientflow and then use that variable instead of response.content in the messagelogging policy.
Thanks a lot for pointing out this solution! It is exactly what I was looking for.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |