This page summarizes the logs available in Stackdriver Logging from App Engine. For more information about App Engine logging, see Using Cloud logging in App Engine apps.
App Engine writes Admin Activity audit logs,
activity in the Logs Viewer.
Standard environment logs
The App Engine standard environment produces the following logs:
request_login the Logs Viewer. This log records requests sent to all App Engine apps. The request log is provided by default and you cannot opt out of receiving it. For more details, see the
Application logs consist of additional application information included in the request logs. The information is provided by default and you cannot opt out of receiving it. For more details, see the
Third party package logs. Some third-party package logs are also produced, including
nginx.requestin the Logs Viewer.
Log entries from App Engine use the resource type
Request log field labels
For the App Engine standard environment request log, the following predefined
names can be used as Logs Viewer field labels; see
Field path identifiers for
All fields contain string values except for
||The number of bytes in the response to the client. Example:
||The HTTP method. Example:
||The path appended to your host's address. Example:
||The protocol used. Example:
||The query string on the request, if any. Example:
||The host making the request. Example:
||The RFC 1413 client ID.|
||The numeric status code returned to the client: Example:
||An authorized user, if any.|
||The browser or other agent making the requests. Example:
App Engine flexible environment logs
The App Engine flexible environment produces the following logs:
Request logs record requests sent to all App Engine apps. The request log is provided by default and you cannot opt out of receiving it.
Application logs record activity by software within the App Engine app. The log is provided by default and you cannot opt out of receiving it.
Runtime logs are provided from the flexible environment using a preinstalled Stackdriver Logging agent. By changing the default configuration of the agent, you can opt in or opt out of specific logs. See Stackdriver Logging in App Engine Apps for more information.
Custom logs can be used with the flexible environment. By writing log files to a specific directory, your app can opt in to using these logs. See Stackdriver Logging in App Engine Apps for more information.
Logs from the flexible environment include resources of type
Applications logs and request logs
Request and applications logs are stored separately in the flexible environment.
|Log type||Payload type||Purpose|
||text||Requests made to your apps in the flexible environment.|
||text or structured||Application logs entries from your apps in the flexible environment.|
Linking application logs and requests
In the App Engine flexible environment, application logs can be correlated with a particular request. Following are the requirements:
The "parent" log entry must include a value for
The "child" log entry must have a different log name than the parent. Typically, the child log entry is an application log entry in the
applog, whereas the parent log entry is in the
requestlog. The values for
tracemust be the same in the parent and its child(ren).
The child log entry's
timestampmust be within the time interval covered by the parent request. It must be earlier than
parent.timestampand later than
parent.timestamp - parent.httpRequest.latency.
For more information on log entries, see the LogEntry data type in the Stackdriver Logging API.
The App Engine flexible environment can write additional logs from the runtimes. See Stackdriver Logging in App Engine Apps for more information. Following are some of the logs that are configured by default:
||Shows audit log information.|
||Information from the container where your app is running.|
||Shows errors surfaced from within the nginx process.|
||Shows nginx logs specifically for health checks. Reduces noise in the request logs.|
||Shows logs from the nginx proxy as they are passed through to the app container.|
||Information logged on shutdown.|
||Standard output from your app container.|
||Standard error from your app container.|
||Operational events related to instances.|
||Information logged on shutdown.|
||The VM syslog, outside of the app container.|
VM events logging
You can gain insight into events related to your App Engine flexible environment
instances using the
vm.events stream in Logging. The following events are
logged in this stream:
- Instance creation
- Instance termination (and why, reported on a best-effort basis)
- Instance health check aggregate statistics reported approximately every minute
- Instance unlocked for debugging or instance was accessed via SSH
Note that the
vm.events stream may not report events in chronological order.
You can get diagnostic information when your app container is stopped. For example, this might happen if an app is unresponsive due to a deadlock or high load and has stopped returning requests, including health checks.
To help diagnose issues, you can get debug information, such as thread traces
and heap statistics, from the app container through Stackdriver Logging
vm.shutdown, there are logs from Docker containers including the app
container and other sidecar containers, such as nginx, for both healthy and
If your app is unhealthy, you can get other logs in
vm.shutdown such as:
- Tail of app logs
- Additional debug information: machine type, memory and disk usage, etc.
In the Java runtime, shutdown logging for the application container is built into the JVM. For more information, see the documentation.
App Engine apps can write their own logs to a designated directory, in which case the logs will appear in
Stackdriver Logging prefixed by the string
See Stackdriver Logging in App Engine Apps for more information.
|Log name||Payload type||Purpose|
||text or structured||Custom logs from your apps.|