I have installed: Serilog.sink.console in my asp.net core web project. I have the below set up to use serilog when I call the Microsoft.Extension.Logging ILogger:
.UseSerilog((context, loggerConfiguration) => loggerConfiguration
.ReadFrom.Configuration(context.Configuration))
I have the following settings to log to Console in my appsettings.json:
"Serilog": {
"MinimumLevel": "Error",
"WriteTo": [
{
"Name": "Console"
}
]
Below is how I try to log to console:
private readonly ILogger _logger; // using Microsoft.Extensions.Logging
public SalesTransaction(ILogger<Sales> logger)
{
_logger = logger;
}
Console.WriteLine("XXX");
_logger.LogError("This is an Error");
I cannot find where the Console/STDOut is logged. Note that if I use WriteTo File settings and specify a directory, it works fine.