I am using Serilog logger together with a Console sink to do logging in my ASP.NET Core 5.0 project. Also use the same ILoggerFactory with EF Core 5.0 like below
optionsBuilder.UseLoggerFactory(serilogFactory)
But when EF Core logs SQL statements, the lines are not shown as linebreak on the console, instead it is shown as \r\n instead.
But if I use the builtin LoggerFactory from ASP.NET Core like below
var loggerFactory = LoggerFactory.Create(
builder => builder.AddConsole(options =>
{
})
);
optionsBuilder.UseLoggerFactory(loggerFactory);
Then it's fine.
Is there a way to fix that?