public static 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 | 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. |