Reference documentation and code samples for the Stackdriver Logging Client class Sink.
A sink is used to export log entries outside Stackdriver Logging.
Example:
use Google\Cloud\Logging\LoggingClient;
$logging = new LoggingClient();
$sink = $logging->sink('my-sink');
Namespace
Google \ Cloud \ LoggingMethods
__construct
| Parameters | |
|---|---|
| Name | Description |
connection |
Connection\Gapic
Represents a connection to Cloud Logging. This object is created by LoggingClient, and should not be instantiated outside of this client. |
name |
string
The sink's name. |
projectId |
string
The project's ID. |
info |
array
[optional] The sink's metadata. |
exists
Check whether or not the sink exists.
Example:
if ($sink->exists()) {
echo 'Sink exists!';
}
| Parameter | |
|---|---|
| Name | Description |
options |
array
[optional] Configuration Options |
| Returns | |
|---|---|
| Type | Description |
bool |
|
delete
See also:
| Parameter | |
|---|---|
| Name | Description |
options |
array
[optional] Configuration Options. |
update
See also:
| Parameters | |
|---|---|
| Name | Description |
metadata |
array
The data to update. |
↳ destination |
string
The export destination. Please see Exporting Logs With Sinks for more information and examples. |
↳ filter |
string
|
options |
array
[optional] Configuration Options. |
| Returns | |
|---|---|
| Type | Description |
array |
|
info
See also:
| Parameter | |
|---|---|
| Name | Description |
options |
array
[optional] Configuration Options. |
| Returns | |
|---|---|
| Type | Description |
array |
|
reload
See also:
| Parameter | |
|---|---|
| Name | Description |
options |
array
[optional] Configuration Options. |
| Returns | |
|---|---|
| Type | Description |
array |
|
name
Returns the sink's name.
Example:
echo $sink->name();
| Returns | |
|---|---|
| Type | Description |
string |
|