Google.Cloud.Diagnostics.Common - Class EventTarget (5.1.0)

public sealed class EventTarget

Reference documentation and code samples for the Google.Cloud.Diagnostics.Common class EventTarget.

Represents the location error events will be sent.

Inheritance

object > EventTarget

Namespace

GoogleCloudGoogle.Cloud.DiagnosticsCommon

Assembly

Google.Cloud.Diagnostics.Common.dll

Properties

Kind

public EventTargetKind Kind { get; }

The type of location to send error events to.

Property Value
TypeDescription
EventTargetKind

LogTarget

public LogTarget LogTarget { get; }

If this even target type is Logging, this is the target log to send error reports to. It will be null otherwise. Note that currently, only Logging is supported then, in practice, this will never be null.

Property Value
TypeDescription
LogTarget

ProjectId

public string ProjectId { get; }

If LogTarget is of Project this is ProjectId. Null otherwise.

Property Value
TypeDescription
string

Methods

ForLogTarget(LogTarget)

public static EventTarget ForLogTarget(LogTarget target)

Creates a new EventTarget instance that will report to the Google Cloud Logging API. The events are then automatically propagated to the Google Cloud Error Logging API from the Google Cloud Logging API.

Parameter
NameDescription
targetLogTarget

The LogTarget to create the EventTarget from. Must not be null.

Returns
TypeDescription
EventTarget
Remarks

For more information see "Formatting Log Error Messages" (https://cloud.google.com/error-reporting/docs/formatting-error-messages).

ForProject(string)

public static EventTarget ForProject(string projectId)

Creates a new EventTarget instance that will report to the Google Cloud Logging API. The events are then automatically propagated to the Google Cloud Error Logging API from the Google Cloud Logging API.

Parameter
NameDescription
projectIdstring

The project ID to create the underlying LogTarget from. Must not be null.

Returns
TypeDescription
EventTarget
Remarks

For more information see "Formatting Log Error Messages" (https://cloud.google.com/error-reporting/docs/formatting-error-messages).