Google App Engine PHP 7 (standard) error log request

771 Views Asked by At

With php 5.5 app engine standard, errors showed in Stackdriver with the request meta data (see screenshot): enter image description here

With php 7 standard, no meta data: enter image description here

How can I link the request meta data to the error with app engine php 7 standard?

1

There are 1 best solutions below

6
Andrei Tigau On

You should have the data that you need in the Stackdriver Logging. As it is stated in the documentation :

When a request is sent to your application running in App Engine, request and response details are logged automatically, and can be viewed in the Google Cloud Console Stackdriver Logging Logs Viewer.

You just need to go to Stackdriver Logging and match the error that was reported. Than click on expand and you will see all the data associated to the problematic request.

You can also configure the views for the logs, in order to make them more, or less detailes, or to define their priorities. Moreover, you can write your own logs with all the data that you want to include within them :

When your application handles a request, it can write its own logging messages to stdout and stderr. Write your application logs using stdout for output and stderr for errors. These files are automatically collected and can be viewed in the Logs Viewer.