I am new to WinUI development, I created a new simple WinUI 3.0 app (using Viusal Studio template Blank App, Packaged (WinUI 3 in desktop)
I also installed the following
$ dotnet add package Serilog
$ dotnet add package Serilog.Sinks.Console
$ dotnet add package Serilog.Sinks.File
This is how my App.xaml.cs constructor looks like.
public App()
{
this.InitializeComponent();
Log.Logger = new LoggerConfiguration()
.WriteTo.Console()
.WriteTo.File("logs\\myapp.txt", rollingInterval: RollingInterval.Day)
.CreateLogger();
Log.Information("Application Starting");
}
I don't see any logs on the console or file being created too. What could I be doing wrong? Are there some special permissions I need to request etc. Appreciate any tips or debugging suggestions for me, thank you.