How do I view error details in Google API Console?
Asked Answered
B

0

7

This is probably the stupidest question, but I cannot find any answer in Google's own docs:

Question: Is there a way to view detailed error reports in Google's API console?

Details: I am using the Google Drive API to view and create files, and in the Google API console I can view metrics that show me error counts by API method, by response code, etc. But just knowing I have a bunch of "4xx" errors does not help me much, especially when the errors are sporadic. Is there any detailed logging available for the Google API that might help me see more specifically what went wrong when these errors popped up? It seems like this info should be somewhere (they bothered to make the nice plot showing when the errors occured, just no details on what the error was...) but I can't find how to access it.

Edit: To clarify, I am not asking how to log items myself, but how to access the existing logs generated by Google API Console.

Edit: My initial guess was to check the Google Logs Explorer, but everything in the Dashboard tab reports "No data is available for the selected time frame", and any queries I make appear to return empty.

Bumbailiff answered 26/10, 2020 at 5:11 Comment(9)
Did you check in console.cloud.google.com/logs ?Frondescence
@Frondescence Yes I have, but everything appears to be empty or blank. Looking at the "Logs Dashboard" tab, every chart says "No data is available for the selected time frame." When I type in any query within my project, there don't appear to be any results at all. I updated the OP to clarify this.Bumbailiff
Ok, please share the minimal code, which will reproduce your "4XX" errors so we can take a look.Frondescence
@Frondescence Unfortunately, that is the precise reason for my question. I have no idea what in my app is causing the 4XX errors to generate. Out of 500,000 GET requests, I have had ~6,000 4XX errors (~98.75% success rate). I want to examine the logs at Google to find out what the full error was in those random rare occurences.Bumbailiff
Ok, where is your application being served from? And if you are receiving the error codes correctly from the Drive API, you should be able to parse the error message and log it in your server. What language are you using?Frondescence
@Frondescence I am able to log items in my server (on Heroku), but the question here is not whether I can log items myself. While I appreciate your willingness to help, I'm afraid this is answering the wrong question. The question is "Is there a way to view detailed error reports in Google's API console?" Even if I add some detailed logging output for these errors, I still want to know how to (or if it is possible) to access logs from Google for future reference. It seems like they already have all of the statistics, times, etc., and I want to take advantage of that without duplicating it myself.Bumbailiff
Well I think that would be the Drive APIs backend at Google who are keeping these logs with the associated metadata, since it is their server processing your request.Frondescence
@Frondescence Correct, which leads back to my original question: How do I access those logs?Bumbailiff
I don't believe they are public.Frondescence

© 2022 - 2024 — McMap. All rights reserved.