Does Apigee support Graylog for message logging. if I give just the IP and port for the message logging policy, will it work in apigee for graylog. I understand for graylog to work, we need to install logstash in the client side, but I am not sure, what has to be done in edge side. Can anybody help me here.
@krushna.padhee.ap : Apigee can support logging to an external Log System over HTTP
STEP-1 : Configure a GELF HTTP listener on Graylog. Please refer Graylog docs for configuring incoming data [http://docs.graylog.org/en/2.1/pages/sending_data.html](http://Graylog Configuration Doc)
(http://Graylog Configuration Doc)
STEP2: Test GELF Listener is getting data over HTTP. Refer a Postman screenshot
STEP3 : Configure a Service Callout in an Apigee Proxy to Send Apigee Proxy Logs over HTTP to Graylog. Refer following code for Service Callout configuration
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout async="true" continueOnError="false"enabled="true" name="Log2Graylog">
<DisplayName>Log2Graylog</DisplayName>
<Properties/>
<Request clearPayload="true" variable="myRequest">
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<Set>
<Payload contentType="application/json" variablePrefix="@" variableSuffix="#">
{"event":"Logged from EDGE"}
</Payload>
<Verb>POST</Verb>
</Set>
</Request>
<Response>calloutResponse</Response>
<HTTPTargetConnection>
<Properties/>
<URL>http://192.168.1.13:12201/gelf</URL>
</HTTPTargetConnection>
</ServiceCallout>
STEP4 : Graylog will Display Messages in the configured HTTP listener as shown Below
Incase you need to integrate with other popular logging systems like Splunk , you may refer following community articles and docs
Splunk :https://community.apigee.com/articles/13298/log-messages-into-splunk.html
Sumo Logic : [Logging to Sumo Logic using JavaScript and HTTP - Google Cloud Community](http://Sumo Logic)
Cheers !
Saurabh Chhatwal
Thanks a lot Saurabh, I will try your inputs…
Hi Saurabh,
I found one limitation, the service callout policy which is not allowed to have in response flow in apigee edge, in that way, I can’t log my error logs from the response. Do you have any solution for that.
Regards,
Krushna
@krushna.padhee.ap That’s not true Krushna. You can use service call out policy in any flow except the PostClientFlow.

