Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



google/appengine/api/log/LogService.php

Table of Contents
Copyright 2007 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

\google\appengine\api\log\LogService

Package: Default
The LogService allows an application to query for request and application logs.

Application logs are added to a the current request log by calling

Link
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
When fetching application logs or filtering request logs by severity use the values in the right hand column.

Constants

> V Constant LEVEL_DEBUG = 0
Constants for application log levels.
> V Constant LEVEL_INFO = 1
> V Constant LEVEL_WARNING = 2
> V Constant LEVEL_ERROR = 3
> V Constant LEVEL_CRITICAL = 4
> V Constant MAX_BATCH_SIZE = 1000
The maximum number of request logs returned in each batch.

Methods

method public fetch (array $options = array()) : \google\appengine\api\log\Iterator
static

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

Parameters
Name Type Description
$options array

Optional 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
Type Description
\google\appengine\api\log\Iterator The matching <code>RequestLog</code> items.
method public fetchById (mixed $request_ids, boolean $include_app_logs = true) : \google\appengine\api\log\RequestLog[]
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
Name Type Description
$request_ids mixed

A string request id or an array of string request ids obtained from RequestLog::getRequestId() .

$include_app_logs boolean

Should applicaiton logs be included in the fetched request logs. Defaults to true - application logs are included.

Returns
Type Description
\google\appengine\api\log\RequestLog[] The request logs for ids that were found.
method public getAppEngineLogLevel (integer $syslog_level) : integer
static

Translates a PHP syslog priority level into a Google App Engine severity level.

Useful when filtering logs by minimum severity level given the syslog level.

Parameters
Name Type Description
$syslog_level integer

The priority level passed to syslog .

Returns
Type Description
integer The app engine severity level.
Documentation was generated by phpDocumentor 2.0.0a12 .