![]() |
App Engine PHP SDK
v1 rev.445
The PHP runtime is available as an experimental Preview feature.
|
Static Public Member Functions | |
static | fetch (array $options=[]) |
static | fetchById ($request_ids, $include_app_logs=true) |
static | getAppEngineLogLevel ($syslog_level) |
Public Attributes | |
const | LEVEL_DEBUG = 0 |
const | LEVEL_INFO = 1 |
const | LEVEL_WARNING = 2 |
const | LEVEL_ERROR = 3 |
const | LEVEL_CRITICAL = 4 |
const | MAX_BATCH_SIZE = 1000 |
The LogService allows an application to query for request and application logs. Application logs are added to a the current request log by calling syslog(int $priority, string $message). The $priority used when creating the application log is translated into a different scale of severity used by the LogService. Application logs have a level in order of increasing severity:
syslog $priority
GAE severity
LOG_DEBUG
LOG_INFO
LogService::LEVEL_INFO
LOG_NOTICE
LogService::LEVEL_INFO
LOG_WARNING
LogService::LEVEL_WARNING
LOG_ERR
LogService::LEVEL_ERROR
LOG_CRIT
LogService::LEVEL_CRITICAL
LOG_ALERT
LogService::LEVEL_CRITICAL
LOG_EMERG
LogService::LEVEL_CRITICAL
fetching application logs or filtering request logs by severity use the values in the right hand column.
|
static |
Get request logs matching the given options in reverse chronological order of request end time.
array | $options | Optional associateive arrary of filters and modifiers from following: |
DateTime or numeric
The earliest completion time or last-update time for request logs. If the value is numeric it represents microseconds since Unix epoch. DateTime or numeric
The latest completion time or last-update time for request logs. If the value is numeric it represents microseconds since Unix epoch. string
The url-safe offset value from a RequestLog
to continue iterating after. integer
Only return request logs containing at least one application log of this severity or higher. Works even if include_app_logs is not true
boolean
Should incomplete request logs be included. The default is false
- only completed logs are returned boolean
Should application logs be returned. The default is false
- application logs are not returned with their containing request logs. array
The versions of the default module for which to fetch request logs. Only one of 'versions' and 'module_versions' can be used. arrary/code> An associative array of module names to versions for which to fetch request logs. Each module name may be mapped to either a single string
version or an array
of versions.
'batch_size': integer
The number of request logs to pre-fetch while iterating.
RequestLog
items.
|
static |
Get request logs for the given request log ids and optionally include the application logs addded during each request. Request log ids that are not found are ignored so the returned array may have fewer items than $request_ids
.
mixed | $request_ids | A string request id or an array of string request ids obtained from RequestLog::getRequestId() . |
boolean | $include_app_logs | Should applicaiton logs be included in the fetched request logs. Defaults to true - application logs are included. |
|
static |
Translates a PHP <syslog>syslog<syslog> priority level into a Google App Engine severity level. Useful when filtering logs by minimum severity level given the syslog level.
integer | $syslog_level | The priority level passed to syslog . |
const google\appengine\api\log\LogService::LEVEL_DEBUG = 0 |
Constants for application log levels.
const google\appengine\api\log\LogService::MAX_BATCH_SIZE = 1000 |
The maximum number of request logs returned in each batch.