Google Cloud Logging v2 API - Class LoggingServiceV2.LoggingServiceV2Client (4.4.0)

public class LoggingServiceV2.LoggingServiceV2Client : ClientBase<LoggingServiceV2.LoggingServiceV2Client>

Reference documentation and code samples for the Google Cloud Logging v2 API class LoggingServiceV2.LoggingServiceV2Client.

Client for LoggingServiceV2

Inheritance

object > ClientBase > ClientBaseLoggingServiceV2LoggingServiceV2Client > LoggingServiceV2.LoggingServiceV2Client

Namespace

Google.Cloud.Logging.V2

Assembly

Google.Cloud.Logging.V2.dll

Constructors

LoggingServiceV2Client()

protected LoggingServiceV2Client()

Protected parameterless constructor to allow creation of test doubles.

LoggingServiceV2Client(CallInvoker)

public LoggingServiceV2Client(CallInvoker callInvoker)

Creates a new client for LoggingServiceV2 that uses a custom CallInvoker.

Parameter
Name Description
callInvoker CallInvoker

The callInvoker to use to make remote calls.

LoggingServiceV2Client(ChannelBase)

public LoggingServiceV2Client(ChannelBase channel)

Creates a new client for LoggingServiceV2

Parameter
Name Description
channel ChannelBase

The channel to use to make remote calls.

LoggingServiceV2Client(ClientBaseConfiguration)

protected LoggingServiceV2Client(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration

The client configuration.

Methods

DeleteLog(DeleteLogRequest, CallOptions)

public virtual Empty DeleteLog(DeleteLogRequest request, CallOptions options)

Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.

Parameters
Name Description
request DeleteLogRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Empty

The response received from the server.

DeleteLog(DeleteLogRequest, Metadata, DateTime?, CancellationToken)

public virtual Empty DeleteLog(DeleteLogRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.

Parameters
Name Description
request DeleteLogRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Empty

The response received from the server.

DeleteLogAsync(DeleteLogRequest, CallOptions)

public virtual AsyncUnaryCall<Empty> DeleteLogAsync(DeleteLogRequest request, CallOptions options)

Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.

Parameters
Name Description
request DeleteLogRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

DeleteLogAsync(DeleteLogRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Empty> DeleteLogAsync(DeleteLogRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.

Parameters
Name Description
request DeleteLogRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

ListLogEntries(ListLogEntriesRequest, CallOptions)

public virtual ListLogEntriesResponse ListLogEntries(ListLogEntriesRequest request, CallOptions options)

Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs.

Parameters
Name Description
request ListLogEntriesRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListLogEntriesResponse

The response received from the server.

ListLogEntries(ListLogEntriesRequest, Metadata, DateTime?, CancellationToken)

public virtual ListLogEntriesResponse ListLogEntries(ListLogEntriesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs.

Parameters
Name Description
request ListLogEntriesRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListLogEntriesResponse

The response received from the server.

ListLogEntriesAsync(ListLogEntriesRequest, CallOptions)

public virtual AsyncUnaryCall<ListLogEntriesResponse> ListLogEntriesAsync(ListLogEntriesRequest request, CallOptions options)

Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs.

Parameters
Name Description
request ListLogEntriesRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListLogEntriesResponse

The call object.

ListLogEntriesAsync(ListLogEntriesRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListLogEntriesResponse> ListLogEntriesAsync(ListLogEntriesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs.

Parameters
Name Description
request ListLogEntriesRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListLogEntriesResponse

The call object.

ListLogs(ListLogsRequest, CallOptions)

public virtual ListLogsResponse ListLogs(ListLogsRequest request, CallOptions options)

Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.

Parameters
Name Description
request ListLogsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListLogsResponse

The response received from the server.

ListLogs(ListLogsRequest, Metadata, DateTime?, CancellationToken)

public virtual ListLogsResponse ListLogs(ListLogsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.

Parameters
Name Description
request ListLogsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListLogsResponse

The response received from the server.

ListLogsAsync(ListLogsRequest, CallOptions)

public virtual AsyncUnaryCall<ListLogsResponse> ListLogsAsync(ListLogsRequest request, CallOptions options)

Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.

Parameters
Name Description
request ListLogsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListLogsResponse

The call object.

ListLogsAsync(ListLogsRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListLogsResponse> ListLogsAsync(ListLogsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.

Parameters
Name Description
request ListLogsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListLogsResponse

The call object.

ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest, CallOptions)

public virtual ListMonitoredResourceDescriptorsResponse ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest request, CallOptions options)

Lists the descriptors for monitored resource types used by Logging.

Parameters
Name Description
request ListMonitoredResourceDescriptorsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListMonitoredResourceDescriptorsResponse

The response received from the server.

ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest, Metadata, DateTime?, CancellationToken)

public virtual ListMonitoredResourceDescriptorsResponse ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists the descriptors for monitored resource types used by Logging.

Parameters
Name Description
request ListMonitoredResourceDescriptorsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListMonitoredResourceDescriptorsResponse

The response received from the server.

ListMonitoredResourceDescriptorsAsync(ListMonitoredResourceDescriptorsRequest, CallOptions)

public virtual AsyncUnaryCall<ListMonitoredResourceDescriptorsResponse> ListMonitoredResourceDescriptorsAsync(ListMonitoredResourceDescriptorsRequest request, CallOptions options)

Lists the descriptors for monitored resource types used by Logging.

Parameters
Name Description
request ListMonitoredResourceDescriptorsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListMonitoredResourceDescriptorsResponse

The call object.

ListMonitoredResourceDescriptorsAsync(ListMonitoredResourceDescriptorsRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListMonitoredResourceDescriptorsResponse> ListMonitoredResourceDescriptorsAsync(ListMonitoredResourceDescriptorsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists the descriptors for monitored resource types used by Logging.

Parameters
Name Description
request ListMonitoredResourceDescriptorsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListMonitoredResourceDescriptorsResponse

The call object.

NewInstance(ClientBaseConfiguration)

protected override LoggingServiceV2.LoggingServiceV2Client NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration
Returns
Type Description
LoggingServiceV2LoggingServiceV2Client
Overrides

TailLogEntries(CallOptions)

public virtual AsyncDuplexStreamingCall<TailLogEntriesRequest, TailLogEntriesResponse> TailLogEntries(CallOptions options)

Streaming read of log entries as they are ingested. Until the stream is terminated, it will continue reading logs.

Parameter
Name Description
options CallOptions

The options for the call.

Returns
Type Description
AsyncDuplexStreamingCallTailLogEntriesRequestTailLogEntriesResponse

The call object.

TailLogEntries(Metadata, DateTime?, CancellationToken)

public virtual AsyncDuplexStreamingCall<TailLogEntriesRequest, TailLogEntriesResponse> TailLogEntries(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Streaming read of log entries as they are ingested. Until the stream is terminated, it will continue reading logs.

Parameters
Name Description
headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncDuplexStreamingCallTailLogEntriesRequestTailLogEntriesResponse

The call object.

WriteLogEntries(WriteLogEntriesRequest, CallOptions)

public virtual WriteLogEntriesResponse WriteLogEntries(WriteLogEntriesRequest request, CallOptions options)

Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders)

Parameters
Name Description
request WriteLogEntriesRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
WriteLogEntriesResponse

The response received from the server.

WriteLogEntries(WriteLogEntriesRequest, Metadata, DateTime?, CancellationToken)

public virtual WriteLogEntriesResponse WriteLogEntries(WriteLogEntriesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders)

Parameters
Name Description
request WriteLogEntriesRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
WriteLogEntriesResponse

The response received from the server.

WriteLogEntriesAsync(WriteLogEntriesRequest, CallOptions)

public virtual AsyncUnaryCall<WriteLogEntriesResponse> WriteLogEntriesAsync(WriteLogEntriesRequest request, CallOptions options)

Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders)

Parameters
Name Description
request WriteLogEntriesRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallWriteLogEntriesResponse

The call object.

WriteLogEntriesAsync(WriteLogEntriesRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<WriteLogEntriesResponse> WriteLogEntriesAsync(WriteLogEntriesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders)

Parameters
Name Description
request WriteLogEntriesRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallWriteLogEntriesResponse

The call object.