Description
Description
When specifying a logger through the Logger property of the options, it appears that this logger is not the one that will be used to log requests.
Reproduction
app.UseSerilogRequestLogging(options => { options.Logger = myLogger; });
Expected behavior
I expect that the middleware will directly use the logger instance provided through the options. However, it appears that the middleware calls a ForContext() on that logger to obtain the logger it will use. Therefore, the configuration of the provided logger is ignored, as it is not used.
Relevant package, tooling and runtime versions
.NET 6, Serilog.AspNetCore 6.1.0
Additional context
I was expecting to be able to use a logger for a context controlled outside of the middleware, as we are logging requests (for other protocols than HTTP) at other places in our apps and therefore have more general configuration than just the Serilog middleware context.