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

public static class ContextExceptionLogger

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

Functions to create IContextExceptionLoggers.

Inheritance

object > ContextExceptionLogger

Namespace

GoogleCloudGoogle.Cloud.DiagnosticsCommon

Assembly

Google.Cloud.Diagnostics.Common.dll

Methods

Create(ErrorReportingServiceOptions, IServiceProvider)

public static IContextExceptionLogger Create(ErrorReportingServiceOptions options, IServiceProvider serviceProvider)
Parameters
NameDescription
optionsErrorReportingServiceOptions

The error reporting options. May be null, in which case defaults will be used, in particular, if running on Google Cloud, the Google Cloud project ID to log to will be detected from the platform.

serviceProviderIServiceProvider

The service provider to obtain services from. May be null, in which case some context information won't be added to the LogEntry.

Returns
TypeDescription
IContextExceptionLogger

An IContextExceptionLogger for the given options.

Create(string, string, string, ErrorReportingOptions)

public static IContextExceptionLogger Create(string projectId, string serviceName, string version, ErrorReportingOptions options)
Parameters
NameDescription
projectIdstring

The Google Cloud Platform project ID. If unspecified and running on GAE or GCE the project ID will be detected from the platform.

serviceNamestring

An identifier of the service, such as the name of the executable or job. May be null.

versionstring

Represents the source code version that the developer provided. May be null.

optionsErrorReportingOptions

The error reporting options. Can be null, if null default options will be used.

Returns
TypeDescription
IContextExceptionLogger

An IContextExceptionLogger for the given options.

Remarks

This method will call Create(string, string, string, ErrorReportingOptions, IServiceProvider) passing a null value for the IServiceProvider parameter, which means that some context information cannot be added to log entries because there are no services to obtain that information from.

Create(string, string, string, ErrorReportingOptions, IServiceProvider)

public static IContextExceptionLogger Create(string projectId, string serviceName, string version, ErrorReportingOptions options, IServiceProvider serviceProvider)
Parameters
NameDescription
projectIdstring

The Google Cloud Platform project ID. If unspecified and running on GAE or GCE the project ID will be detected from the platform.

serviceNamestring

An identifier of the service, such as the name of the executable or job. May be null.

versionstring

Represents the source code version that the developer provided. May be null.

optionsErrorReportingOptions

The error reporting options. Can be null, if null default options will be used.

serviceProviderIServiceProvider

The service provider to obtain services from. May be null, in which case some context information won't be added to the LogEntry.

Returns
TypeDescription
IContextExceptionLogger

An IContextExceptionLogger for the given options.