While working on a POC I got the following warning/error when trying to add some logging:
Here is the exact error message:
CS0619: ‘ConsoleLoggerExtensions.AddConsole(ILoggerFactory)’ is obsolete: ‘This method is retained only for compatibility. The recommended alternative is AddConsole(this ILoggingBuilder builder).
There are multiple ways to get rid of this warning, but I solved it by using the following code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loggerFactory= LoggerFactory.Create(builder => builder.AddConsole()); |
Happy coding!