public static class ContextExceptionLoggerReference documentation and code samples for the Google.Cloud.Diagnostics.Common class ContextExceptionLogger.
Functions to create IContextExceptionLoggers.
Namespace
Google.Cloud.Diagnostics.CommonAssembly
Google.Cloud.Diagnostics.Common.dll
Methods
Create(ErrorReportingServiceOptions, IServiceProvider)
public static IContextExceptionLogger Create(ErrorReportingServiceOptions options, IServiceProvider serviceProvider)Creates an IContextExceptionLogger.
| Parameters | |
|---|---|
| Name | Description |
options |
ErrorReportingServiceOptionsThe 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 |
IServiceProviderThe 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 |
stringThe Google Cloud Platform project ID. If unspecified and running on GAE or GCE the project ID will be detected from the platform. |
serviceName |
stringAn identifier of the service, such as the name of the executable or job. May be null. |
version |
stringRepresents the source code version that the developer provided. May be null. |
options |
ErrorReportingOptionsThe 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 |
stringThe Google Cloud Platform project ID. If unspecified and running on GAE or GCE the project ID will be detected from the platform. |
serviceName |
stringAn identifier of the service, such as the name of the executable or job. May be null. |
version |
stringRepresents the source code version that the developer provided. May be null. |
options |
ErrorReportingOptionsThe error reporting options. Can be null, if null default options will be used. |
serviceProvider |
IServiceProviderThe 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. |