From b57cf04f35b89bb29720f6902b19652819f3a211 Mon Sep 17 00:00:00 2001 From: byCrookie Date: Tue, 13 Feb 2024 20:50:05 +0100 Subject: [PATCH] fix size of logging files --- Directory.Packages.props | 123 ++++++++++++----------- GithubBackup.Cli/GithubBackup.Cli.csproj | 45 +++++---- GithubBackup.Cli/Logging/CliLogger.cs | 6 +- 3 files changed, 88 insertions(+), 86 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index d4ccfb1..d8ba9af 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,63 +1,64 @@ - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + \ No newline at end of file diff --git a/GithubBackup.Cli/GithubBackup.Cli.csproj b/GithubBackup.Cli/GithubBackup.Cli.csproj index 9797adf..f692147 100644 --- a/GithubBackup.Cli/GithubBackup.Cli.csproj +++ b/GithubBackup.Cli/GithubBackup.Cli.csproj @@ -4,7 +4,7 @@ Exe Linux - + ghb true @@ -13,36 +13,37 @@ - - - - - - + + + + + + + - all - runtime; build; native; contentfiles; analyzers; buildtransitive + all + runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + - all - runtime; build; native; contentfiles; analyzers; buildtransitive + all + runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + - - - + + + diff --git a/GithubBackup.Cli/Logging/CliLogger.cs b/GithubBackup.Cli/Logging/CliLogger.cs index e83c3e0..74be092 100644 --- a/GithubBackup.Cli/Logging/CliLogger.cs +++ b/GithubBackup.Cli/Logging/CliLogger.cs @@ -1,3 +1,4 @@ +using ByteSizeLib; using GithubBackup.Cli.Commands.Global; using GithubBackup.Cli.Utils; using Serilog; @@ -17,9 +18,8 @@ public static LoggerConfiguration Create(GlobalArgs globalArgs) configuration.WriteTo.File( globalArgs.LogFile.FullName, rollOnFileSizeLimit: true, - fileSizeLimitBytes: 100_000_000, - retainedFileCountLimit: 10, - rollingInterval: RollingInterval.Infinite + fileSizeLimitBytes: (long)ByteSize.FromMegaBytes(50).Bytes, + retainedFileCountLimit: 2 ).MinimumLevel.Is(logEventLevel); }