Class ContextExceptionLogger (4.3.1)

public static class ContextExceptionLogger

Functions to create IContextExceptionLoggers.

Inheritance

Object > ContextExceptionLogger

Namespace

Google.Cloud.Diagnostics.Common

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.