调试云端点:发出请求时出错,但日志中没有请求

时间:2023-01-06 23:10:35

I have an issue with debugging and Cloud Endpoints. I'm using tons of endpoints in my application, and one endpoint consistently returns with error code 500, message "Internal Error".

我在调试和云端点方面存在问题。我在我的应用程序中使用了大量的端点,并且一个端点始终返回错误代码500,消息“内部错误”。

This endpoint does not appear in my app's logs, and when I run its code directly in the interactive console (in production), everything works fine.

此端点不会出现在我的应用程序日志中,当我直接在交互式控制台(生产中)运行其代码时,一切正常。

There might be a bug in my code that I am failing to see, however, the real problem here is that the failing endpoints request is NOT showing up in my app's logs – which leaves me with no great way to debug the problem.

我的代码中可能存在一个我无法看到的错误,但是,真正的问题是失败的端点请求没有显示在我的应用程序日志中 - 这让我没有很好的方法来调试问题。

Any tips? Is it possible to force some kind of "debug" mode where more information (such as a stack trace) is conveyed back to me in the 500 response from endpoints? Why isn't the failing request showing up in my app's logs?

有小费吗?是否可以强制某种“调试”模式,在端点的500响应中将更多信息(例如堆栈跟踪)传回给我?为什么我的应用程序日志中没有显示失败的请求?

2 个解决方案

#1


1  

Just in case you aren't aware - by default the Logs webpage does not show you the lowest level log statements. That missing level ('D', I think) adds lots of Endpoints log statements that occur prior to the invocation of your code, so they could be useful in the situation you describe.

万一你不知道 - 默认情况下,日志网页不会显示最低级别的日志语句。缺少的级别(我认为'D')会添加许多在调用代码之前发生的端点日志语句,因此它们在您描述的情况下可能很有用。

I also find it useful to retrieve my log statements with 'appcfg' (in the GAE SDK), e.g.

我还发现使用'appcfg'(在GAE SDK中)检索我的日志语句很有用,例如

appcfg --num_days=1 --severity=0 request_logs myfile.log

#2


0  

Check if you are running out of resources.

检查您的资源是否用完。

#1


1  

Just in case you aren't aware - by default the Logs webpage does not show you the lowest level log statements. That missing level ('D', I think) adds lots of Endpoints log statements that occur prior to the invocation of your code, so they could be useful in the situation you describe.

万一你不知道 - 默认情况下,日志网页不会显示最低级别的日志语句。缺少的级别(我认为'D')会添加许多在调用代码之前发生的端点日志语句,因此它们在您描述的情况下可能很有用。

I also find it useful to retrieve my log statements with 'appcfg' (in the GAE SDK), e.g.

我还发现使用'appcfg'(在GAE SDK中)检索我的日志语句很有用,例如

appcfg --num_days=1 --severity=0 request_logs myfile.log

#2


0  

Check if you are running out of resources.

检查您的资源是否用完。