-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Determine next log file number from directory on first run #41375
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
Conversation
8ca29ea to
f58b5c8
Compare
|
Could you explain how this is different from the current logic? We already attempt to pick up where we left off on restart: aspnetcore/src/Middleware/HttpLogging/src/FileLoggerProcessor.cs Lines 151 to 171 in bcdb13d
There is a bug on line 162, though, which should be |
|
I added a test in FileLoggerProcessorTests.cs to clarify what this logic is intended to address. If you stick a breakpoint on this line, the fileCounter is now starting at 4 when the processor is constructed again. Previously it would start back over at 0.
I'll fix that and add a test. |
wtgodbe
left a comment
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.
I see, seems like a good behavioral change. Thanks for the catch & fix!
f58b5c8 to
933d2d8
Compare
|
Tests are updated, let me know if there's anything missing. With this PR, the assignment to |
933d2d8 to
5c65eb5
Compare
|
Would it be possible to backport this fix into net6 since that is LTS? |
Generally we hesitate to take behavioral changes back to servicing since somebody might be relying on the old behavior, but in this case that seems unlikely. I'll open a backport of this against the release/6.0 branch & see if we can get it through the review process. |
|
/backport to release/6.0 |
|
Started backporting to release/6.0: https://github.com/dotnet/aspnetcore/actions/runs/2259120895 |
|
@wtgodbe backporting to release/6.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Determine next log file number from directory on first run
Using index info to reconstruct a base tree...
M src/Middleware/HttpLogging/src/FileLoggerProcessor.cs
M src/Middleware/HttpLogging/test/FileLoggerProcessorTests.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Middleware/HttpLogging/test/FileLoggerProcessorTests.cs
CONFLICT (content): Merge conflict in src/Middleware/HttpLogging/test/FileLoggerProcessorTests.cs
Auto-merging src/Middleware/HttpLogging/src/FileLoggerProcessor.cs
CONFLICT (content): Merge conflict in src/Middleware/HttpLogging/src/FileLoggerProcessor.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Determine next log file number from directory on first run
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
|
Ah, right, file-scoped-namespaces. @dustinsoftware could you open a backport of this against the |
Thought that was fixed with #41087? |
I thought that only affected |
sure :) |
|
Hi @dustinsoftware. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
Determine next log file number from directory on first run
Summary of the changes (Less than 80 chars)
Description
Fixes #41326