diff --git a/HuTao.Culling/Program.cs b/HuTao.Culling/Program.cs index ee847ce..a4907c0 100644 --- a/HuTao.Culling/Program.cs +++ b/HuTao.Culling/Program.cs @@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Serilog; +using Serilog.Events; namespace HuTao.Culling; @@ -63,6 +64,14 @@ public async Task StartAsync(string[] args) _services = ConfigureServices(); _db = _services.GetRequiredService(); + Log.Logger = new LoggerConfiguration() + .MinimumLevel.Override("Hangfire", LogEventLevel.Debug) + .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) + .MinimumLevel.Verbose() + .Enrich.FromLogContext() + .WriteTo.Console() + .CreateLogger(); + var days = int.Parse(args.First()); var oldest = DateTimeOffset.Now.ToUniversalTime() - TimeSpan.FromDays(days); await CullMessagesInternalAsync(oldest);