Class GoogleDiagnosticsWebHostBuilderExtensions (4.3.1)

[Obsolete("Use Google.Cloud.Diagnostics.AspNetCore3.AspNetCoreGoogleDiagnosticsExtensions instead.")]
public static class GoogleDiagnosticsWebHostBuilderExtensions

Extensions to configure Google Diagnostics on the IWebHostBuilder.

Inheritance

Object > GoogleDiagnosticsWebHostBuilderExtensions

Namespace

Google.Cloud.Diagnostics.AspNetCore3

Assembly

Google.Cloud.Diagnostics.AspNetCore3.dll

Methods

UseGoogleDiagnostics(IWebHostBuilder, Func<WebHostBuilderContext, String>, Func<WebHostBuilderContext, String>, Func<WebHostBuilderContext, String>, Func<WebHostBuilderContext, LoggerOptions>, Func<WebHostBuilderContext, TraceOptions>, Func<WebHostBuilderContext, ErrorReportingOptions>)

[Obsolete("Use Google.Cloud.Diagnostics.AspNetCore3.AspNetCoreGoogleDiagnosticsExtensions instead.")]
public static IWebHostBuilder UseGoogleDiagnostics(this IWebHostBuilder builder, Func<WebHostBuilderContext, string> projectIdGetter, Func<WebHostBuilderContext, string> serviceNameGetter, Func<WebHostBuilderContext, string> serviceVersionGetter, Func<WebHostBuilderContext, LoggerOptions> loggerOptionsGetter = null, Func<WebHostBuilderContext, TraceOptions> traceOptionsGetter = null, Func<WebHostBuilderContext, ErrorReportingOptions> errorReportingOptionsGetter = null)

Configures Google Diagnostics services for Logging, Tracing and Error Reporting middleware.

Parameters
NameDescription
builderIWebHostBuilder

The IWebHostBuilder instance.

projectIdGetterFunc<WebHostBuilderContext, String>

A function that takes a WebHostBuilderContext and retrieves the Google Cloud Platform project ID. Cannot be null but can return a null value for the project ID, in such a case and if running on GAE/GCE/GKE the project ID will be detected from the platform.

serviceNameGetterFunc<WebHostBuilderContext, String>

A function that takes a WebHostBuilderContext and retrieves the identifier of the service used for exception logging, such as the name of the executable or job. Cannot be null but can return a null value for the service name, in such a case and if running on GAE the service name will be detected from the platform.

serviceVersionGetterFunc<WebHostBuilderContext, String>

A function that takes a WebHostBuilderContext and retrieves the version of the service or the source code used for exception logging. Cannot be null but can return a null value for the service version, in such a case and if running on GAE the service version will be detected from the platform.

loggerOptionsGetterFunc<WebHostBuilderContext, LoggerOptions>

A function that takes a WebHostBuilderContext and retrieves the options to use for logging. May be null or return a null value for the options; in either of these cases the default options will be used.

traceOptionsGetterFunc<WebHostBuilderContext, TraceOptions>

A function that takes a WebHostBuilderContext and retrieves the options to use for tracing. May be null or return a null value for the options; in either of these cases the default options will be used.

errorReportingOptionsGetterFunc<WebHostBuilderContext, ErrorReportingOptions>

A function that takes a WebHostBuilderContext and retrieves the options to use for errorReporting. May be null or return a null value for the options; in either of these cases the default options will be used.

Returns
TypeDescription
IWebHostBuilder

The IWebHostBuilder instance.

UseGoogleDiagnostics(IWebHostBuilder, String, String, String, LoggerOptions, TraceOptions, ErrorReportingOptions)

[Obsolete("Use Google.Cloud.Diagnostics.AspNetCore3.AspNetCoreGoogleDiagnosticsExtensions instead.")]
public static IWebHostBuilder UseGoogleDiagnostics(this IWebHostBuilder builder, string projectId = null, string serviceName = null, string serviceVersion = null, LoggerOptions loggerOptions = null, TraceOptions traceOptions = null, ErrorReportingOptions errorReportingOptions = null)

Configures Google Diagnostics services for Logging, Tracing and Error Reporting middleware.

Parameters
NameDescription
builderIWebHostBuilder

The IWebHostBuilder instance.

projectIdString

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

serviceNameString

An identifier of the service used for exception logging (through Error Reporting), such as the name of the executable or job. If unspecified and running on GAE the service name will be detected from the platform. This may be different from ServiceName which is used for log entries logged with GoogleLogger.

serviceVersionString

A string that represents the version of the service or the source code used for exception logging. If unspecified and running on GAE the service version will be detected from the platform. This may be different from Version which is used for log entries logged with GoogleLogger.

loggerOptionsLoggerOptions

The options for logging. May be null, in which case default options will be used.

traceOptionsTraceOptions

The options for tracing. May be null, in which case default options will be used.

errorReportingOptionsErrorReportingOptions

The options for error reporting. May be null, in which case default options will be used.

Returns
TypeDescription
IWebHostBuilder

The IWebHostBuilder instance.