On-demand Logging of payload in APIGEE Cloud and Integration with GrayLog

Hi All,

I am looking for an option in APIGEE to log payloads in an on-demand basis i.e. if my APIs are failing continuously, I would prefer to get the payload of those requests. Is this possible? If yes, how?

Also, I am looking for a way to integrate the APIGEE API logs with Graylog. Can you please suggest the steps here?

Thanks

1 6 461
6 REPLIES 6

Not applicable

if failing you can add a logging policy in your fault rules. You can also do in post client flow with response code with errors to execute. But as the api calls are stateless, we cannot find which one is failing continuously during runtime.

Apigee message logging policy allows you to directly send the logs to logger(here Graylog) and also allows you to put the files to message processors and from there using the logger's connector software you can send to the logger.

Thanks for the quick response.

I will try these and let you know.

Also, do you have any information on what logs can be pushed from Apigee to Gray Log?

Not applicable

Message logging policy creates log files in message processor for each proxy with file rotation.

The policy looks like

<MessageLogging name="LogPolicy">

<File>

<Message>This is a test message. Message id : {request.header.messageid}</Message>

<FileName>test.log</FileName>

<FileRotationOptions rotateFileOnStartup="true">

<FileRotationType>SIZE</FileRotationType>

<MaxFileSizeInMB>10</MaxFileSizeInMB>

<MaxFilesToRetain>10</MaxFilesToRetain>

</FileRotationOptions>

</File>

<logLevel>ERROR</logLevel>

</MessageLogging>

And the log stores in below path of message processor

/opt/apigee/var/log/edge-message-processor/messagelogging/org_name/environment/api_proxy_name/revision/logging_policy_name/

Ref: https://docs.apigee.com/api-platform/reference/policies/message-logging-policy#location

Thanks for the update. Currently, we don't have access to these message processors.

We are setting up a new environment so I wanted to understand if these logs contain request and response payloads along with the target url.

Whatever you want to log you can specify in the message logging policy Message tag.

Logging request and respond Payload is a security threat. So, if it's not explicitly required, you should not log the payloads.

Yes got it.

Thanks.