13

I have a server running over Google App Engine.

I am viewing my server's request-log via the console.

They are located under Google Cloud Platform --> Stackdriver Logging --> Logs.

I would like to view the arguments of a POST-Request.


With a GET-Request it is easy, as they are visible in the title of the entry.

They are also viable in the body of the entry, under protoPayload --> resource.

With a POST-Request, however, they are nowhere to be found.

Here are my options:

  • 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.

How can I find them within GAE logs?

6
  • 5
    I don't believe POST parameters are automatically displayed in logs due to security reasons. You don't want username/passwords that users may post on a site available in log files. You can explicitly output request params to logs from app engine code using logger.info in your code. Commented Jun 27, 2016 at 13:51
  • @JeffDeskins: OK, so that would be considered as application-logs, not request-logs, right? Commented Jun 27, 2016 at 13:52
  • @barakmanos, the two logs are one and the same. Using 'logging.info will add additional information to the Stackdriver logs that you are looking at. Commented Jun 27, 2016 at 14:12
  • 1
    @Kekito: As far as I understand, the request-log comes automatically (i.e., generated for every request that the server receives), and the application-log is (indeed) generated from my logging operations. So these logs are different to my understanding. Is that correct? And will I have to do logging in order to get the arguments of any POST-Request? Thanks. Commented Jun 27, 2016 at 14:15
  • @barakmanos, no that is incorrect. A logging.info() shows up in the Stackdriver request logs and that is the only way to see POST arguments. Just try it! Commented Jun 27, 2016 at 22:36

1 Answer 1

6

post request data isn't shown in request logs.

In your app, you must explicitly log it

logging.log(myRequest.PostData) 

Edit: just be careful logging sensitive customer information.

Sign up to request clarification or add additional context in comments.

5 Comments

Where should this be applied @robert king? I'm not able to find it.
inside your request handler. depends what web framework you use but search for how to log
you could also try "print", although logging is better
I've searched a lot and I still trying to accomplish this. I'm running a PHP app with a flexible environment. Docs are really poor. Where should I look at? Thanks in advance.
cloud.google.com/appengine/docs/standard/php/logs seems you can use echo or syslog

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.