-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add rollOnFileSizeLimit #60
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
<PropertyGroup> | ||
<Description>Add file logging to ASP.NET Core apps with one line of code.</Description> | ||
<VersionPrefix>3.0.1</VersionPrefix> | ||
<VersionPrefix>4.0.1</VersionPrefix> | ||
<Authors>Serilog Contributors</Authors> | ||
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net5.0;net6.0</TargetFrameworks> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
|
@@ -32,9 +32,9 @@ | |
<ItemGroup> | ||
<PackageReference Include="Serilog" Version="2.10.0" /> | ||
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" /> | ||
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" /> | ||
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" /> | ||
<PackageReference Include="Serilog.Formatting.Compact" Version="1.1.0" /> | ||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not possible to migrate to Serilog.Sinks.File without a substantial breaking change because of the differences in path formatting and rolling options; I think it's time we migrated, but there's more to discuss around it, so it'd be best discussed in a separate PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so I do not need to migrate in this pr? I do not see any option in old library about it, https://github.com/serilog/serilog-sinks-rollingfile/blob/dev/src/Serilog.Sinks.RollingFile/RollingFileLoggerConfigurationExtensions.cs and without option rotation will not work There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nblumhardt Hello, can you help here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @kgrodimov - no need to migrate in this PR. The old library determines the rolling interval from the output path format string - if it includes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so how can I add roll by size if old library does not support this parameter There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, for not answering. I think throw exception is a better way, as user can expect to roll by HalfHour, for example. So I need to check, if path contains: Something else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the This only works when If you're keen to explore it, we could also consider adding a HTH! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So just trim out rollingInterval only if it immediately precedes the extension and pass correct interval with RollingInterval to Serilog.Sinks.File according to parsed value. So not only {Date}, but {Hour}, {HalfHour} also, or just {Day} as most popular. New library does not support {HalfHour} btw, https://github.com/serilog/serilog-sinks-file/blob/2d2e00b31c4c1ed36dbbca8f4a43389856964fae/src/Serilog.Sinks.File/Sinks/File/RollingIntervalExtensions.cs#L23. So for {HalfHour} can I throw exception? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry about the slow reply; yes, I think throwing an exception in that case would make sense 👍 |
||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a binary breaking change, we should bump the version number to 4.0.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed number