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: 5.3.13+628b0876960af3ee3454c99b7985dbb5e1c46bf0
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