| AspNetExtensionsAddNLog Method (ILoggingBuilder, LoggingConfiguration, NLogAspNetCoreOptions) |
Enable NLog as logging provider for Microsoft Extension Logging, and explicit load NLog LoggingConfiguration
Namespace:
NLog.Web
Assembly:
NLog.Web.AspNetCore (in NLog.Web.AspNetCore.dll) Version: 5.3.13+628b0876960af3ee3454c99b7985dbb5e1c46bf0
Syntax public static ILoggingBuilder AddNLog(
this ILoggingBuilder builder,
LoggingConfiguration configuration,
NLogAspNetCoreOptions options
)
<ExtensionAttribute>
Public Shared Function AddNLog (
builder As ILoggingBuilder,
configuration As LoggingConfiguration,
options As NLogAspNetCoreOptions
) As ILoggingBuilder
Dim builder As ILoggingBuilder
Dim configuration As LoggingConfiguration
Dim options As NLogAspNetCoreOptions
Dim returnValue As ILoggingBuilder
returnValue = builder.AddNLog(configuration,
options)
[<ExtensionAttribute>]
static member AddNLog :
builder : ILoggingBuilder *
configuration : LoggingConfiguration *
options : NLogAspNetCoreOptions -> ILoggingBuilder
Parameters
- builder
- Type: ILoggingBuilder
The logging builder - configuration
- Type: NLog.ConfigLoggingConfiguration
Config for NLog - options
- Type: NLog.WebNLogAspNetCoreOptions
Options for registration of the NLog LoggingProvider and enabling features.
Return Value
Type:
ILoggingBuilderUsage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
ILoggingBuilder. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Remarks Recommended to use AddNLogWeb() to avoid name-collission issue with NLog.Extension.Logging namespace
See Also