Свойство | Тип | Описание | |
---|---|---|---|
$connection | Represents a connection to Stackdriver Logging. |
Метод | Описание | |
---|---|---|
__construct ( array $config = [] ) | Create a Logging client. | |
createMetric ( string $name, string $filter, array $options = [] ) : |
Create a metric. | |
createSink ( string $name, string $destination, array $options = [] ) : |
Create a sink. | |
entries ( array $options = [] ) : Generator |
Fetches log entries. | |
logger ( string $name, array $options = [] ) : |
Fetches a logger which will write log entries to Stackdriver Logging. | |
metric ( string $name ) : |
Lazily instantiates a metric. There are no network requests made at this point. To see the operations that can be performed on a metric please see {@see Google\Cloud\Logging\Metric}. | |
metrics ( array $options = [] ) : Generator |
Fetches metrics associated with your project. | |
psrLogger ( string $name, array $options = [] ) : |
Fetches a logger which will write log entries to Stackdriver Logging and implements the PSR-3 specification. | |
sink ( string $name ) : |
Lazily instantiates a sink. There are no network requests made at this point. To see the operations that can be performed on a sink please see {@see Google\Cloud\Logging\Sink}. | |
sinks ( array $options = [] ) : Generator |
Fetches sinks associated with your project. |
public __construct ( array $config = [] ) | ||
$config | array | [optional] { Configuration options. @type string $projectId The project ID from the Google Developer's Console. @type CacheItemPoolInterface $authCache A cache for storing access tokens. **Defaults to** a simple in memory implementation. @type array $authCacheOptions Cache configuration options. @type callable $authHttpHandler A handler used to deliver Psr7 requests specifically for authentication. @type callable $httpHandler A handler used to deliver Psr7 requests. Only valid for requests sent over REST. @type string $keyFile The contents of the service account credentials .json file retrieved from the Google Developers Console. @type string $keyFilePath The full path to your service account credentials .json file retrieved from the Google Developers Console. @type int $retries Number of retries for a failed request. **Defaults to** `3`. @type array $scopes Scopes to be used for the request. @type string $transport The transport type used for requests. May be either `grpc` or `rest`. **Defaults to** `grpc` if gRPC support is detected on the system. } |
public createMetric ( string $name, string $filter, array $options = [] ) : |
||
$name | string | The name of the metric. |
$filter | string | An [advanced logs filter](https://cloud.google.com/logging/docs/view/advanced_filters). |
$options | array | [optional] { Configuration Options. @type string $description A description of the metric. } |
Результат |
public createSink ( string $name, string $destination, array $options = [] ) : |
||
$name | string | The name of the sink. |
$destination | string | The export destination. Please see [Exporting Logs With Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs#about_sinks) for more information and examples. |
$options | array | [optional] { Configuration options. @type string $filter An [advanced logs filter](https://cloud.google.com/logging/docs/view/advanced_filters). @type string $outputVersionFormat The log entry version to use for this sink's exported log entries. This version does not have to correspond to the version of the log entry when it was written to Stackdriver Logging. May be either `V1` or `V2`. **Defaults to** `V2`. } |
Результат |
public entries ( array $options = [] ) : Generator |
||
$options | array | [optional] { Configuration options. @type string[] $projectIds A list of projectIds to fetch entries from in addition to entries found in the project bound to this client. @type string[] $resourceNames One or more cloud resources from which to retrieve log entries. Projects listed in projectIds are added to this list. Example: "projects/my-project-1A", "projects/1234567890". @type string $filter An [advanced logs filter](https://cloud.google.com/logging/docs/view/advanced_filters). @type string $orderBy How the results should be sorted. Presently, the only permitted values are `timestamp asc` and `timestamp desc`. **Defaults to** `"timestamp asc"`. @type int $pageSize The maximum number of results to return per request. } |
Результат | Generator |
public logger ( string $name, array $options = [] ) : |
||
$name | string | The name of the log to write entries to. |
$options | array | [optional] { Configuration options. @type array $resource The [monitored resource](https://cloud.google.com/logging/docs/api/reference/rest/Shared.Types/MonitoredResource) to associate log entries with. **Defaults to** type global. @type array $labels A set of user-defined (key, value) data that provides additional information about the log entry. } |
Результат |
public psrLogger ( string $name, array $options = [] ) : |
||
$name | string | The name of the log to write entries to. |
$options | array | [optional] { Configuration options. @type string $messageKey The key in the `jsonPayload` used to contain the logged message. **Defaults to** `message`. @type array $resource The [monitored resource](https://cloud.google.com/logging/docs/api/reference/rest/Shared.Types/MonitoredResource) to associate log entries with. **Defaults to** type global. @type array $labels A set of user-defined (key, value) data that provides additional information about the log entry. } |
Результат |