Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

unable to log response body to Message logging policy

Hi,

I'm trying to log response body using Message Logging policy. i have implemented the same using below links

https://community.apigee.com/articles/14798/log-messages-into-loggly.html and

https://community.apigee.com/questions/18906/messagelogging-to-loggly.html

but i am not able to attach response content/error content to the message logging policy.

below is the message logging policy and java script policy i used and attached is the trace outputs for 200 and 401 codes for your reference.

message logging policy.

<MessageLogging name="PostClientFlowAX">
  <DisplayName>PostClientFlowAX</DisplayName>
  <Syslog>
    <Message>[xxx-xxxxxxxxx@41058 tag="{organization.name}.{apiproxy.name}.{environment.name}"] {'logResponse'} </Message>
    <Host>logs-01.loggly.com</Host>
    <Port>514</Port>
  </Syslog>
</MessageLogging>

javascript policy.

context.setVariable('logResponse', context.getVariable("response.content"))

but i am not able to log response content.Request your suggestion here.

regards,

Ramakrishna

0 3 1,166
3 REPLIES 3