I get no log output at all on my release app. Even when logging with logger.LogError() there is nothing added to any log file. I'm currently using Serilog for the first time inside a MAUI 9.0.40 application with Serilog 4.2.0, Serilog.Extensions.Hosting 9.0.0, Serilog.Sinks.Debug 3.0.0 and Serilog.Sinks.File 6.0.0.
This is my current logger setup:
services.AddSerilog(new LoggerConfiguration()
.Enrich.FromLogContext()
.WriteTo.Debug()
.WriteTo.File(Path.Combine(FileSystem.Current.AppDataDirectory, "Logs", "log.txt"),
rollingInterval: RollingInterval.Day,
fileSizeLimitBytes: 10485760,
retainedFileCountLimit: 7)
.CreateLogger());
Also logger.IsEnabled(LogLevel.Error) return false when build for Release but true when build for Debug?? I have no idea what I'm missing or did wrong so I assume it's just a bug? Anyone has a hint what I'm missing here?