 | AspNetExtensionsAddNLog Method (ILoggingBuilder, LoggingConfiguration) |
Note: This API is now obsolete.
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: 6.0.0+59339f2811712b446adf6dcd8a6bad39ad9f2ba1
Syntax[ObsoleteAttribute("Instead use AddNLogWeb() for explicit registration of NLog.Web.AspNetCore extensions. Marked obsolete with Nlog 6.0")]
public static ILoggingBuilder AddNLog(
this ILoggingBuilder builder,
LoggingConfiguration configuration
)<ExtensionAttribute>
<ObsoleteAttribute("Instead use AddNLogWeb() for explicit registration of NLog.Web.AspNetCore extensions. Marked obsolete with Nlog 6.0")>
Public Shared Function AddNLog (
builder As ILoggingBuilder,
configuration As LoggingConfiguration
) As ILoggingBuilder
Dim builder As ILoggingBuilder
Dim configuration As LoggingConfiguration
Dim returnValue As ILoggingBuilder
returnValue = builder.AddNLog(configuration)[<ExtensionAttribute>]
[<ObsoleteAttribute("Instead use AddNLogWeb() for explicit registration of NLog.Web.AspNetCore extensions. Marked obsolete with Nlog 6.0")>]
static member AddNLog :
builder : ILoggingBuilder *
configuration : LoggingConfiguration -> ILoggingBuilder
Parameters
- builder
- Type: ILoggingBuilder
The logging builder - configuration
- Type: NLog.ConfigLoggingConfiguration
Config for NLog
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).
RemarksRecommended to use AddNLogWeb() to avoid name-collission issue with NLog.Extension.Logging namespace
See Also