| AspNetExtensionsSetupNLogServiceLocator Method |
Note: This API is now obsolete.
Override the default IServiceProvider used by the NLog ServiceLocator.
NLog ServiceLocator uses the IServiceProvider to access context specific services (Ex. IHttpContextAccessor)
Namespace:
NLog.Web
Assembly:
NLog.Web.AspNetCore (in NLog.Web.AspNetCore.dll) Version: 5.3.13+628b0876960af3ee3454c99b7985dbb5e1c46bf0
Syntax [ObsoleteAttribute("Use UseNLog() on IHostBuilder / IWebHostBuilder, or AddNLogWeb() on ILoggingBuilder")]
public static IServiceProvider SetupNLogServiceLocator(
this IServiceProvider serviceProvider
)
<ExtensionAttribute>
<ObsoleteAttribute("Use UseNLog() on IHostBuilder / IWebHostBuilder, or AddNLogWeb() on ILoggingBuilder")>
Public Shared Function SetupNLogServiceLocator (
serviceProvider As IServiceProvider
) As IServiceProvider
Dim serviceProvider As IServiceProvider
Dim returnValue As IServiceProvider
returnValue = serviceProvider.SetupNLogServiceLocator()
[<ExtensionAttribute>]
[<ObsoleteAttribute("Use UseNLog() on IHostBuilder / IWebHostBuilder, or AddNLogWeb() on ILoggingBuilder")>]
static member SetupNLogServiceLocator :
serviceProvider : IServiceProvider -> IServiceProvider
Parameters
- serviceProvider
- Type: SystemIServiceProvider
Return Value
Type:
IServiceProviderUsage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IServiceProvider. 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
Should only be used if the standard approach for configuring NLog is not enough
See Also