在Google App Engine日志中查看POST请求的参数 [英] View the arguments of a POST-Request in Google App Engine logs
问题描述
我有一台运行在Google App Engine上的服务器.
I have a server running over Google App Engine.
我正在通过控制台查看服务器的请求日志.
I am viewing my server's request-log via the console.
它们位于 Google Cloud Platform->下.Stackdriver记录->日志
.
我想查看POST请求的参数.
I would like to view the arguments of a POST-Request.
使用GET请求很容易,因为它们在条目的标题中可见.
With a GET-Request it is easy, as they are visible in the title of the entry.
它们在条目的正文中也是可行的,位于 protoPayload->下.资源
.
They are also viable in the body of the entry, under protoPayload --> resource
.
但是,对于POST请求,找不到它们了.
With a POST-Request, however, they are nowhere to be found.
这是我的选择:
-
元数据
-
protoPayload
-
insertId
-
日志
-
httpRequest
-
操作
metadata
protoPayload
insertId
log
httpRequest
operation
这些选项似乎都不包含请求的参数.
None of these options seem to contain the arguments of the request.
从此答案中,我知道它们应该在请求正文中.
From this answer, I understand that they should be within the request-body.
如何在GAE日志中找到它们?
How can I find them within GAE logs?
推荐答案
发布请求数据未显示在请求日志中.
在您的应用中,您必须明确记录它
In your app, you must explicitly log it
logging.log(myRequest.PostData)
小心记录敏感的客户信息.
just be careful logging sensitive customer information.
这篇关于在Google App Engine日志中查看POST请求的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!