Google\Cloud\Logging\LoggingClient::createSink PHP Метод

createSink() публичный Метод

Example: $sink = $logging->createSink('my-sink', 'storage.googleapis.com/my-bucket');
См. также: https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.sinks/create projects.sinks create API documentation.
public createSink ( string $name, string $destination, array $options = [] ) : Sink
$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`. }
Результат Sink
    public function createSink($name, $destination, array $options = [])
    {
        $response = $this->connection->createSink($options + ['parent' => $this->formattedProjectName, 'name' => $name, 'destination' => $destination, 'outputVersionFormat' => 'VERSION_FORMAT_UNSPECIFIED']);
        return new Sink($this->connection, $name, $this->projectId, $response);
    }