Skip to content

Commit

Permalink
fix size of logging files
Browse files Browse the repository at this point in the history
  • Loading branch information
byCrookie committed Feb 13, 2024
1 parent 334dfcd commit b57cf04
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 86 deletions.
123 changes: 62 additions & 61 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,63 +1,64 @@
<Project>
<ItemGroup>
<PackageVersion Include="AutoBogus" Version="2.13.1" />
<PackageVersion Include="Bogus" Version="34.0.2" />
<PackageVersion Include="FluentAssertions" Version="7.0.0-alpha.1" />
<PackageVersion Include="FluentValidation" Version="11.8.1" />
<PackageVersion Include="Flurl.Http" Version="3.2.4" />
<PackageVersion Include="Meziantou.Xunit.ParallelTestFramework" Version="2.1.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.0" />
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="8.0.0" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Octokit" Version="8.0.1" />
<PackageVersion Include="Polly" Version="8.2.0" />
<PackageVersion Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<PackageVersion Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageVersion Include="Roslyn.System.IO.Abstractions.Analyzers" Version="12.2.19" />
<PackageVersion Include="Serilog" Version="3.1.1" />
<PackageVersion Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageVersion Include="Spectre.Console" Version="0.48.0" />
<PackageVersion Include="Spectre.Console.Analyzer" Version="0.48.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Spectre.Console.Testing" Version="0.48.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Runtime.Caching" Version="8.0.0" />
<PackageVersion Include="System.Threading.RateLimiting" Version="8.0.0" />
<PackageVersion Include="TestableIO.System.IO.Abstractions" Version="20.0.4" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.Analyzers" Version="2022.0.0" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.Extensions" Version="2.0.5" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="20.0.4" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.Wrappers" Version="20.0.4" />
<PackageVersion Include="Testcontainers" Version="3.6.0" />
<PackageVersion Include="Verify.Xunit" Version="22.8.0" />
<PackageVersion Include="xunit" Version="2.6.3" />
<PackageVersion Include="xunit.extensibility.core" Version="2.6.3" />
<PackageVersion Include="xunit.extensibility.execution" Version="2.4.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.6.133">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="AutoBogus" Version="2.13.1"/>
<PackageVersion Include="Bogus" Version="34.0.2"/>
<PackageVersion Include="ByteSize" Version="2.1.2"/>
<PackageVersion Include="FluentAssertions" Version="7.0.0-alpha.1"/>
<PackageVersion Include="FluentValidation" Version="11.8.1"/>
<PackageVersion Include="Flurl.Http" Version="3.2.4"/>
<PackageVersion Include="Meziantou.Xunit.ParallelTestFramework" Version="2.1.0"/>
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.0"/>
<PackageVersion Include="Microsoft.Net.Http.Headers" Version="8.0.0"/>
<PackageVersion Include="NSubstitute" Version="5.1.0"/>
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Octokit" Version="8.0.1"/>
<PackageVersion Include="Polly" Version="8.2.0"/>
<PackageVersion Include="Polly.Contrib.WaitAndRetry" Version="1.1.1"/>
<PackageVersion Include="Polly.Extensions.Http" Version="3.0.0"/>
<PackageVersion Include="Roslyn.System.IO.Abstractions.Analyzers" Version="12.2.19"/>
<PackageVersion Include="Serilog" Version="3.1.1"/>
<PackageVersion Include="Serilog.Extensions.Hosting" Version="8.0.0"/>
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0"/>
<PackageVersion Include="Spectre.Console" Version="0.48.0"/>
<PackageVersion Include="Spectre.Console.Analyzer" Version="0.48.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Spectre.Console.Testing" Version="0.48.0"/>
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1"/>
<PackageVersion Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1"/>
<PackageVersion Include="System.Linq.Async" Version="6.0.1"/>
<PackageVersion Include="System.Runtime.Caching" Version="8.0.0"/>
<PackageVersion Include="System.Threading.RateLimiting" Version="8.0.0"/>
<PackageVersion Include="TestableIO.System.IO.Abstractions" Version="20.0.4"/>
<PackageVersion Include="TestableIO.System.IO.Abstractions.Analyzers" Version="2022.0.0"/>
<PackageVersion Include="TestableIO.System.IO.Abstractions.Extensions" Version="2.0.5"/>
<PackageVersion Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="20.0.4"/>
<PackageVersion Include="TestableIO.System.IO.Abstractions.Wrappers" Version="20.0.4"/>
<PackageVersion Include="Testcontainers" Version="3.6.0"/>
<PackageVersion Include="Verify.Xunit" Version="22.8.0"/>
<PackageVersion Include="xunit" Version="2.6.3"/>
<PackageVersion Include="xunit.extensibility.core" Version="2.6.3"/>
<PackageVersion Include="xunit.extensibility.execution" Version="2.4.2"/>
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.6.133">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6"/>
</ItemGroup>
</Project>
45 changes: 23 additions & 22 deletions GithubBackup.Cli/GithubBackup.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<AssemblyName>ghb</AssemblyName>
<PublishSingleFile>true</PublishSingleFile>
Expand All @@ -13,36 +13,37 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentValidation" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="Serilog" />
<PackageReference Include="Serilog.Extensions.Hosting" />
<PackageReference Include="Serilog.Sinks.File" />
<PackageReference Include="Spectre.Console" />
<PackageReference Include="ByteSize"/>
<PackageReference Include="FluentValidation"/>
<PackageReference Include="Microsoft.Extensions.Hosting"/>
<PackageReference Include="Serilog"/>
<PackageReference Include="Serilog.Extensions.Hosting"/>
<PackageReference Include="Serilog.Sinks.File"/>
<PackageReference Include="Spectre.Console"/>
<PackageReference Include="Spectre.Console.Analyzer">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.CommandLine" />
<PackageReference Include="System.CommandLine.Hosting" />
<PackageReference Include="System.Linq.Async" />
<PackageReference Include="System.Threading.RateLimiting" />
<PackageReference Include="TestableIO.System.IO.Abstractions" />
<PackageReference Include="System.CommandLine"/>
<PackageReference Include="System.CommandLine.Hosting"/>
<PackageReference Include="System.Linq.Async"/>
<PackageReference Include="System.Threading.RateLimiting"/>
<PackageReference Include="TestableIO.System.IO.Abstractions"/>
<PackageReference Include="TestableIO.System.IO.Abstractions.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="TestableIO.System.IO.Abstractions.Extensions" />
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" />
<PackageReference Include="TestableIO.System.IO.Abstractions.Extensions"/>
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GithubBackup.Core\GithubBackup.Core.csproj" />
<ProjectReference Include="..\GithubBackup.Core\GithubBackup.Core.csproj"/>
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="GithubBackup.Cli.Tests" />
<InternalsVisibleTo Include="GithubBackup.Cli.Tests.Integration" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" />
<InternalsVisibleTo Include="GithubBackup.Cli.Tests"/>
<InternalsVisibleTo Include="GithubBackup.Cli.Tests.Integration"/>
<InternalsVisibleTo Include="DynamicProxyGenAssembly2"/>
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions GithubBackup.Cli/Logging/CliLogger.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using ByteSizeLib;
using GithubBackup.Cli.Commands.Global;
using GithubBackup.Cli.Utils;
using Serilog;
Expand All @@ -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);
}

Expand Down

0 comments on commit b57cf04

Please sign in to comment.