Use MessageLogger to send to our logging API

Is it possible to use the MessageLogger policy to send messages to a custom logging server via an API? Not Loggly or sumologic, but one that we built? I'd like to use the ServiceCallout policy but it won't execute in the PostClientFlow.

Solved Solved
0 4 371
1 ACCEPTED SOLUTION

Well, only Message Logging(ML) policy can be used in PostClientFlow any other policy won't work. I am not sure if we can hit a Rest endpoint through ML policy

Maybe you can use Service callout(SC) policy without the Response tag as the last policy to execute.

SC without Response tag acts like an asynchronous call ("fire and forget"). Apigee Edge initiates the outbound call, and then immediately continues executing subsequent policies. Since you only want to send logs to your Server, this should work.

View solution in original post

4 REPLIES 4

Well, only Message Logging(ML) policy can be used in PostClientFlow any other policy won't work. I am not sure if we can hit a Rest endpoint through ML policy

Maybe you can use Service callout(SC) policy without the Response tag as the last policy to execute.

SC without Response tag acts like an asynchronous call ("fire and forget"). Apigee Edge initiates the outbound call, and then immediately continues executing subsequent policies. Since you only want to send logs to your Server, this should work.

What flow would the SC go into? Proxy Endpoints PostFlow?

We use it in the Post flow of the Proxy end point.

I used the service callout and put it in the Post Flow as you described. The issue I have with this is that it doesn't execute in the event of an error during the Pre Flow. So I had to add the SC to my error handling logic as well.