From cd8581f86a7391728dd6b78805aebc15a9cb5e61 Mon Sep 17 00:00:00 2001 From: Macocian Alexandru Victor Date: Wed, 7 Jan 2026 21:55:46 +0100 Subject: [PATCH] Setup log rotation policy for Daybreak.API (Closes #1220) (#1230) --- Daybreak.API/Logging/WebApplicationBuilderExtensions.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Daybreak.API/Logging/WebApplicationBuilderExtensions.cs b/Daybreak.API/Logging/WebApplicationBuilderExtensions.cs index 28944940..e2e0c23b 100644 --- a/Daybreak.API/Logging/WebApplicationBuilderExtensions.cs +++ b/Daybreak.API/Logging/WebApplicationBuilderExtensions.cs @@ -21,7 +21,12 @@ public static class WebApplicationBuilderExtensions theme: AnsiConsoleTheme.Sixteen) .WriteTo.File( outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss}] {Level:u4}: [{SourceContext}] [{CorrelationVector}] {NewLine}{Message:lj}{NewLine}{Exception}", - path: "Daybreak.API.log") + path: "Daybreak.API.log", + rollingInterval: RollingInterval.Day, + rollOnFileSizeLimit: true, + fileSizeLimitBytes: 50 * 1024 * 1024, + retainedFileCountLimit: 1, + shared: true) .CreateLogger()); builder.Services.AddScoped(); builder.Services.AddOptions()