I have a serilog middleware class implemented as per this blog post https://blog.datalust.co/smart-logging-middleware-for-asp-net-core/
if i want to use LogContext.PushProperty several time to push various pieces of information in my logging do i just need to put the following code inside my Invoke method:
LogContext.PushProperty("Address", httpContext.Connection.RemoteIpAddress);
LogContext.PushProperty("Username", httpContext.User.Identity.IsAuthenticated ? httpContext.User.Identity.Name : null);
the documentation for LogContext.PushProperty shows only adding one property and says to use a using block or do i need to do something like:
using (LogContext.PushProperty("Address",
httpContext.Connection.RemoteIpAddress))
using (LogContext.PushProperty("Username", httpContext.User.Identity.IsAuthenticated ? httpContext.User.Identity.Name : null))
{ //rest of invoke method here }