Search code examples
wso2-api-manager

logging information of a http request (api call) in wso2am


I've read documentation of wso2am for http access logs in the link https://apim.docs.wso2.com/en/latest/observe/api-manager/monitoring-http-access-logs/ it's written that we should enable http access log only for troubleshooting errors because of performance reason. but i need to log information of every http call( not only for troubleshooting). what is your suggestion?


Solution

  • You can enable the HTTP Access Logs if you are in need to log the incoming API requests in your environment. However, as mentioned in the Docs this will affect the server's performance a little.

    If you are looking to log any specific information about the incoming API requests, you can develop a Synapse mediator or a handler and engage with the APIs that you would like to log. You can also, use the same implementation to enable it globally to log the required information for all the API requests which API Manager receives. You can refer to the following sample Log Handler for reference: Custom API Log Handler.

    Following are the documentations to write custom mediators and handlers