Downloading Logs

App Engine maintains a log of messages that your application emits using the `syslog()` function from the PHP standard library, as well as other messages printed to the standard error stream. App Engine also records each request in the log. Each log severity level has a fixed buffer size that controls the amount of log information you can access. Normally, you use logging features more at lower log levels; thus, the time window is smaller for log events at these levels.

To browse your app's logs of the last 90 days, you can also use the Logs page in the GCP Console.

Requesting the logs

If you wish to perform more detailed analysis of your application's logs, you can download the log data to a file on your computer. The request_logs command is available through the original App Engine SDK for PHP.

To download logs to a file named mylogs.txt, use the following command: request_logs [DIRECTORY_PATH] mylogs.txt

To view all of the options for this command, run: help request_logs

By default, the command downloads log messages from the current calendar day, which starts at midnight Pacific Time. The default log severity level is INFO, which also includes logs for all higher levels but omits DEBUG level messages. The command overwrites the local log file. You can adjust the number of days, the minimum log level, and whether to overwrite or append to the local log file using command-line options.

You can limit the log messages that are downloaded to just those emitted during request on a given domain name using the --vhost=... option. You can use this to download the logs for your live app using a G Suite domain or, excluding log messages emitted by versions you are testing on URLs such as Or you can use it to download just the log messages for a given test domain.

Was this page helpful? Let us know how we did:

Send feedback about...

App Engine standard environment for PHP