How to log API usage messages into Fluentd?

Not applicable
 
0 9 754
9 REPLIES 9

Not applicable

we need transaction details

Not applicable

@sharique as described above you can use the message-logging-policy to capture anything you want on the request or response. But before implementing it, please consider the following:

  • Capturing every request/response will increase the IO the Message Processors is doing and, at some point in time, impact its performance and slow down your APIs. This is not unique to Message Processor but a fact on any system where IO increases.
  • If you require relevant information related to specific data elements on the request or response for reporting purposes, a better alternative is to use Edge analytics and expand the data it captures: http://docs.apigee.com/api-services/reference/statistics-collector-policy
  • If you want to capture data for error analysis, consider only using message-logging-policy on those scenarios. You can apply the policy only when there is an error.
  • If message-logging-policy is used:
    • Consider not to store data on the Message Processor filesystem but use Syslog.
    • Remember that the use of message-logging-policy could result on you capturing "Personally identifiable information" (PII), accounts, password, etc. Consider removing that data or applying procedures to protected and limit access to it.

hi @Maudrit thanks for your reply.

As per your suggestion i added message logging policy

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <MessageLogging async="false" continueOnError="false" enabled="true" name="Message-Logging-Fluentd"> <DisplayName>Message Logging-Fluentd</DisplayName> <Syslog> <Message>message = {request.header.id:unknown_apigee_request_header_id}</Message> <Host>localhost</Host> <Port>8888</Port> <Protocol>TCP</Protocol> <SSLInfo> <Enabled>true</Enabled> </SSLInfo> <FormatMessage>true</FormatMessage> </Syslog> <logLevel>ALERT</logLevel> </MessageLogging>

i also tried port 514

but i am not able to get log information into my third party log server.

@sharique

Port is where the syslog is running. If you don't include this element, the default is 514. Do you know if 514 is being used in your case? confirm the port first.

Do you see any error messages in your MP system.logs? You should see log messages as mentioned here https://community.apigee.com/articles/42504/tcpsyslogsocket-logic.html

Hi @Maruti Chand in my case i am listening to port 5140 at my external logging servrer.

@sharique, Do you see any errors in the logs when you changed the port to 5140?

@Maruti Chand unfortunately i am not getting error for port 5140. just fyi my fluentd log server receives logs from http request e.g curl -X POST -d 'json={"name":"xxxxxxx","role":"yyyyyyy"}' http://xx.xxx.xxx.xx:8888/debug.test.

My log server is configured on AWS EC2.