public static class ContextExceptionLogger
Reference documentation and code samples for the Google.Cloud.Diagnostics.Common class ContextExceptionLogger.
Functions to create IContextExceptionLoggers.
Namespace
GoogleCloudGoogle.Cloud.DiagnosticsCommonAssembly
Google.Cloud.Diagnostics.Common.dll
Methods
Create(ErrorReportingServiceOptions, IServiceProvider)
public static IContextExceptionLogger Create(ErrorReportingServiceOptions options, IServiceProvider serviceProvider)
Creates an IContextExceptionLogger.
Parameters | |
---|---|
Name | Description |
options | ErrorReportingServiceOptions 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. |
serviceProvider | IServiceProvider The service provider to obtain services from. May be null, in which case some context information won't be added to the LogEntry. |
Returns | |
---|---|
Type | Description |
IContextExceptionLogger | An IContextExceptionLogger for the given options. |
Create(string, string, string, ErrorReportingOptions)
public static IContextExceptionLogger Create(string projectId, string serviceName, string version, ErrorReportingOptions options)
Creates an IContextExceptionLogger.
Parameters | |
---|---|
Name | Description |
projectId | string The Google Cloud Platform project ID. If unspecified and running on GAE or GCE the project ID will be detected from the platform. |
serviceName | string An identifier of the service, such as the name of the executable or job. May be null. |
version | string Represents the source code version that the developer provided. May be null. |
options | ErrorReportingOptions The error reporting options. Can be null, if null default options will be used. |
Returns | |
---|---|
Type | Description |
IContextExceptionLogger | An IContextExceptionLogger for the given options. |
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)
Creates an IContextExceptionLogger.
Parameters | |
---|---|
Name | Description |
projectId | string The Google Cloud Platform project ID. If unspecified and running on GAE or GCE the project ID will be detected from the platform. |
serviceName | string An identifier of the service, such as the name of the executable or job. May be null. |
version | string Represents the source code version that the developer provided. May be null. |
options | ErrorReportingOptions The error reporting options. Can be null, if null default options will be used. |
serviceProvider | IServiceProvider The service provider to obtain services from. May be null, in which case some context information won't be added to the LogEntry. |
Returns | |
---|---|
Type | Description |
IContextExceptionLogger | An IContextExceptionLogger for the given options. |