Click or drag to resize

NLogRequestLoggingMiddleware Constructor

Initializes new instance of the NLogRequestLoggingMiddleware class

Namespace:  NLog.Web
Assembly:  NLog.Web.AspNetCore (in NLog.Web.AspNetCore.dll) Version: 6.0.0+59339f2811712b446adf6dcd8a6bad39ad9f2ba1
Syntax
public NLogRequestLoggingMiddleware(
	RequestDelegate next,
	NLogRequestLoggingOptions? options = null,
	ILoggerFactory? loggerFactory = null
)

Parameters

next
Type: RequestDelegate
options (Optional)
Type: NLog.WebNLogRequestLoggingOptions
loggerFactory (Optional)
Type: ILoggerFactory
Remarks
Use the following in Startup.cs:
1public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
2{
3   app.UseMiddleware<NLog.Web.RequestLoggingMiddleware>();
4}
See Also