-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-93205: When rotating logs with no namer specified, match whole extension #93224
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
gh-93205: When rotating logs with no namer specified, match whole extension #93224
Conversation
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
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.
LGTM.
I agree that it is better to separate simpler case with no namer, where the matches can be found unambiguous and more efficiently from more complex case with helper.
It is still not completely unambiguous and can conflict with other TimedRotatingFileHandler with a namer that simply adds an extension, but I'm going to fix this in other issue.
Thanks @ilCatania for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
…le extension (pythonGH-93224) (cherry picked from commit 113687a) Co-authored-by: Gabriele Catania <[email protected]>
GH-115784 is a backport of this pull request to the 3.12 branch. |
…le extension (pythonGH-93224) (cherry picked from commit 113687a) Co-authored-by: Gabriele Catania <[email protected]>
GH-115785 is a backport of this pull request to the 3.11 branch. |
…ole extension (GH-93224) (GH-115784) (cherry picked from commit 113687a) Co-authored-by: Gabriele Catania <[email protected]>
…ole extension (GH-93224) (GH-115785) (cherry picked from commit 113687a) Co-authored-by: Gabriele Catania <[email protected]>
Fixes GH-93205: When setting up multiple logging handlers of type
TimedRotatingFileHandler
that log to the same directory and only differ by the file extension, rollover does not work properly for either of them.There have been a few changes in
TimeRotatingHandler
(GH-90221, GH-89791) due to different file format expectations when a namer is specified versus not specified. This PR fixes the issue in GH-93205 while trying to simplify the code.