Logging in .NET Core Console Applications

source: https://vainolo.com/2021/05/11/logging-in-net-core-console-applications/

Logging should be simple. It should come out of the box in any programming language + framework. I’ve seen too many developers use Console.WriteLine(...) as a way to log in their code because for some reason, wiring logging frameworks is complicated (at least feels complicated).

Read more …

if you are facing this error : CS0117 ‘LoggerFactory’ does not contain a definition for ‘Create’. Run the below command in your solution folder to add the packages to your solution.

$ dotnet add package Microsoft.Extensions.Logging.Console

One comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s