Рет қаралды 14,742
Learn how to setup logging in a WPF application. In WPF, the best destination to write logs is to a file. However, Microsoft does not provide a mechanism to write logs to a file. That said, I also demonstrate how to leverage third-party logging providers, in this case Serilog, to write logs to a file. I go over a few useful configuration options for logging, but this tutorial focuses on setting up the logging rather than all the amazing and advanced configuration options.
TIMESTAMPS:
0:00 - Introduction
1:04 - Demo Introduction
1:48 - Microsoft.Extensions.Logging Setup
3:47 - Configuring Microsoft.Extensions.Logging
5:42 - Microsoft.Extensions.Logging w/ Host
7:15 - Issues w/ Microsoft.Extensions.Logging
8:10 - Serilog Setup
10:01 - Logging to a File w/ Serilog
12:25 - Serilog w/ Host
13:52 - Conclusion
LOGGING DOCS: docs.microsoft.com/en-us/aspn...
SOURCE CODE: github.com/SingletonSean/wpf-...
OTHER LINKS:
Donations: www.paypal.com/biz/fund?id=UB...