| NLogRequestLoggingMiddleware Constructor |
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
)
Public Sub New (
next As RequestDelegate,
Optional options As NLogRequestLoggingOptions = Nothing,
Optional loggerFactory As ILoggerFactory = Nothing
)
Dim next As RequestDelegate
Dim options As NLogRequestLoggingOptions
Dim loggerFactory As ILoggerFactory
Dim instance As New NLogRequestLoggingMiddleware(next, options,
loggerFactory)
new :
next : RequestDelegate *
?options : NLogRequestLoggingOptions *
?loggerFactory : ILoggerFactory
(* Defaults:
let _options = defaultArg options null
let _loggerFactory = defaultArg loggerFactory null
*)
-> NLogRequestLoggingMiddleware
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