Last updated
Last updated
By default, there is no logging enabled. You may use any loggin you want, using the Microsoft builder pattern:
Personally, I am using NLog for many years. So, lets demo how to use NLog.
Create and cadd it to your project (see Demo5)
Set Copy to Output directory
Add NuGet packages
NLog
NLog.Extensions.Logging
Fix your Main()
and add logging
Logging is injected into your Command using dependency injection.
As defined in nlog.config
DEBUG messages go to the log file logs\demo5.log, while
INFO messages are printed on the Console.
The file log is configured to save all DEBUG messages, which include MSPro.CLArgs.
messages