static string LogFilePath(string LogEvent) => $@"{AppContext.BaseDirectory}00_Logs\{LogEvent}\log.log";
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(p => p.Level == LogEventLevel.Debug).WriteTo.Async(c => c.File(LogFilePath("Debug"), rollingInterval: RollingInterval.Day)))
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(p => p.Level == LogEventLevel.Information).WriteTo.Async(c => c.File(LogFilePath("Information"), rollingInterval: RollingInterval.Day)))
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(p => p.Level == LogEventLevel.Warning).WriteTo.Async(c => c.File(LogFilePath("Warning"), rollingInterval: RollingInterval.Day)))
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(p => p.Level == LogEventLevel.Error).WriteTo.Async(c => c.File(LogFilePath("Error"), rollingInterval: RollingInterval.Day)))
.WriteTo.Logger(lg => lg.Filter.ByIncludingOnly(p => p.Level == LogEventLevel.Fatal).WriteTo.Async(c => c.File(LogFilePath("Fatal"), rollingInterval: RollingInterval.Day)))
#if DEBUG
.WriteTo.Async(c => c.Console())
#else
//.Enrich.WithProperty("app", "XXXX")
//.WriteTo.GrafanaLoki(configuration["App:LokiUrl"])
#endif
.CreateLogger();