I'm trying to call loggerFactory.AddSerilog(); as per this documentation, but the AddSerilog method is not recognized:
"Error CS1061 'ILoggerFactory' does not contain a definition for 'AddSerilog' and no extension method 'AddSerilog' accepting a first...".
I'm using ASP.NET CORE with the full .NET framework. What am I doing wrong?
Install Serilog Installing Serilog is simple. First, we open the NuGet Package Manager and search for the Serilog. AspNetCore package and install the latest stable version. After a few seconds, Serilog is installed.
Serilog is a robust API for logging with many configurations and sinks (outputs) and it is straightforward to get started in any . NET version. With . NET 6 the way we used to configure Serilog as a logging provider in .
You may forget this following line in project.json
"Serilog.Extensions.Logging": "1.0.0",
See also https://carlos.mendible.com/2016/09/19/step-step-serilog-asp-net-core/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With