VMware Cloud Community
darrenoid
Enthusiast
Enthusiast

vRA API call logs

I am troubleshooting deployments made using the vRA API. I am trying to find any log files that will show the API calls being received by vRA including the request json payload. I can't seem to find this anywhere.

I have tried using the API to get the request info at catalog-service/api/consumer/requests/{requestID} but the requestData field is always empty. I have also tried looking in /var/log/vcac/catalina.out on the appliance, but the JSON I see there seems to be a modified version of the JSON after the request.

Is there anywhere I can see the API calls as they come in? Like the original POST or GET requests including the request JSON data?

Regards,

Darren

Reply
0 Kudos
4 Replies
daphnissov
Immortal
Immortal

I don't believe this exists. It'd be nice, but I don't think I've ever seen such a log.

Reply
0 Kudos
vmrale
Expert
Expert

Hi,

just to understand your issue. Have you used POST to create Bearer token first? Do you get any information back from vRA using token authentication or nothing at all?

Regards
Radek

If you think your question have been answered correctly, please consider marking it as a solution or rewarding me with kudos.
Reply
0 Kudos
darrenoid
Enthusiast
Enthusiast

Hi vmrale,

The issue is quite strange, intermittent customize OS timeouts in vra, but so far only seen when using the API. I may open another forum post for help once I determine if the issue is vRA or vsphere. The API seems to work fine when I use powershell to test it. In my case we are using the vRA plugin for Jenkins, so a lot of what goes on is under the hood and I can't see it from the plugin side. I wanted to see if there were API call logs I could look at just to make sure the plugin was providing the correct JSON in the request. It's more of a long shot. I am pretty sure if the JSON was malformed the request would not complete at all. I thought it might be helpful to compare the JSON request data from a vra console gui deployment and the API just to see if there was any difference.

I did just find that /var/log/vcac/access_log.txt on the vra appliance has the POST and GET requests listed there, but it is not verbose enough to have the JSON payload listed. Also, the log shows the IP of the appliance instead of the remote IP of the API client making the calls, so it can be hard to filter through.

Reply
0 Kudos
eoinbyrne
Expert
Expert

I think to get the JSON into the log files you would have to modify the "web.xml" file for the CatalogService WebApp to add a RequestDumperFilter definition. vRA uses Pivotal tcServer to host the WebApps for the APIs etc and tcServer is descended from Apache Tomcat

You can see the Tomcat documentation for this here - Apache Tomcat 8 Configuration Reference (8.5.46) - Container Provided Filters

tcServer should handle this the same way as I don't believe the capabilities are any different

According to the documentation on logging, the default HTTP log streams for Tomcat do not include the Request Data anywhere as a value you can print. Also, Tomcat has changed that way this works since i last had to do this (in 6.x you could add a RequestDumperValve to the Server context which could write the Request content for ALL webapps to a log file. In 8.x you now have to modify individual webapps to get this working...this might mean you need to modify a few applications to see ALL the data you want here)

While is approach is entirely possible you'd need to be aware of the following considerations

- You need to modify the web.xml for a file deployed as part of the product so be careful around support

- If you modify the web.xml you will need to restart the tcServer (or reboot the vApp) to see the change

- Sometimes tomcat will redeploy a webapp from it's WAR file on re-starts (if this happens edit the web.xml within the WAR file too...?)

A whole lot of fun to be had here Smiley Happy

Reply
0 Kudos