Message logging to third party systems

Hi there,

I am looking to log request / response payload whenever a 4XX or a 5XX is sent from the target

Question 1 : What is the best way of doing this ?

Question 2 : If 'Message logging' is the answer to Question 1, Can I log messages to third party systems like Azure log analytics or Logz ? (Some solution other than Splunk , logly or sumo logic)

Thank you

0 5 262
5 REPLIES 5

Not applicable

The best way is to use the message logging policy in the post client flow. If you can use the azure log or logz like splunk that's fine. We normally don't push log from apigee message logging policy directly to the logging system. We are pushing the logs to the message processor and we have configured the logging system to pull the data from the message processor. You can follow the same process.

If you have the rest api call to push the logs, then you can use a service callout to push the log from your proxy. As you are thinking of only 4xx and 5xx error logging then you need to configure the service callout in the fault rule.

Thank you for the answer Priyadarshi Ajitav Jena·

Are you referring to the Message logging policy to use syslogs (reference : https://docs.apigee.com/api-platform/reference/policies/message-logging-policy#syslog)

I am saying for FS.

<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>



I do not have an op-premise apigee. FS will work well only for on-premise, right ?

Yes. Then you can use service callout to push the logs using rest api calls.