This article will discuss how to enable Tomcat logging in the API Gateway. Tomcat is a third-party library used for handling all HTTP requests on the API Gateway. At times, clients sending a message to the API Gateway may receive a response back as "HTTP 400" status code, or more often known as "Bad Request". It is often difficult to understand why the client is receiving a Bad Request response, especially when there are no entries for their request in the SSG log files.
Logs for the Tomcat (and Coyote) third-party libraries are disabled by default in the API Gateway.
This article applies to all supported API Gateway versions.
How to add Tomcat logging to the SSG logs:
Once completed, the following error can be observed in the Gateway SSG logs, as an example:
org.apache.coyote.http11.Http11Processor: Error parsing HTTP request header java.lang.IllegalArgumentException: Request header is too large ...
It is recommended to only do the above when troubleshooting and then disabling the Tomcat logs again afterwards. The reason for this is enabling these Tomcat logs can create a lot of extra logging which in-turn creates a lot of extra overhead which will often have a negative impact in performance, especially in an actively used production environment.