App Engine PHP SDK  v1 rev.445
The PHP runtime is available as an experimental Preview feature.
Static Public Member Functions | Public Attributes | List of all members
google\appengine\api\log\LogService Class Reference

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
 

Detailed Description

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

LogService::LEVEL_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.

Member Function Documentation

static google\appengine\api\log\LogService::fetch ( array  $options = [])
static

Get request logs matching the given options in reverse chronological order of request end time.

Parameters
array$optionsOptional associateive arrary of filters and modifiers from following:
  • 'start_time': 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.
  • 'end_time': 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.
  • 'offset': string The url-safe offset value from a RequestLog to continue iterating after.
  • 'minimum_log_level': 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
  • 'include_incomplete': boolean Should incomplete request logs be included. The default is false - only completed logs are returned
  • 'include_app_logs': boolean Should application logs be returned. The default is false - application logs are not returned with their containing request logs.
  • 'versions': array The versions of the default module for which to fetch request logs. Only one of 'versions' and 'module_versions' can be used.
  • 'module_versions': 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.

Returns
Iterator The matching RequestLog items.

static google\appengine\api\log\LogService::fetchById (   $request_ids,
  $include_app_logs = true 
)
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.

Parameters
mixed$request_idsA string request id or an array of string request ids obtained from RequestLog::getRequestId().
boolean$include_app_logsShould applicaiton logs be included in the fetched request logs. Defaults to true - application logs are included.
Returns
RequestLog[] The request logs for ids that were found.
static google\appengine\api\log\LogService::getAppEngineLogLevel (   $syslog_level)
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.

Parameters
integer$syslog_levelThe priority level passed to syslog.
Returns
integer The app engine severity level.

Member Data Documentation

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.


The documentation for this class was generated from the following file: