-
Notifications
You must be signed in to change notification settings - Fork 208
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
Fix the RotatingFileHandler
configuration of the daemon logger
#3891
Fix the RotatingFileHandler
configuration of the daemon logger
#3891
Conversation
The logging configuration for the daemon did already include the definition of a `RotatingFileHandler`, however, the logs were not actually being rolled over when the maximum size was hit. The problem was because the argument `backupCount` was not defined. As the python documentation of the `logging` module states: but if either of `maxBytes` or `backupCount` is zero, rollover never occurs, so you generally want to set `backupCount` to at least 1, and have a non-zero `maxBytes`. Setting `backupCount` to 10, fixes the problem. The size of each file is set to 10 MB. This should then keep at most 100 MB of log files for each profile.
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'm approving, even if there is the risk that huge logs end up deleting all the history? Anyway I think the log often are mostly useful while noticing the problem, not much later.
Is this configurable, maybe?
Right - one question in general would be what should determine the maximum size of a file. In that sense, a backup count of 1 would do the job as well. |
I think it is to have some granularity in how the backup is rolled. More, smaller, files mean that the amount of history deleted at a time is smaller for the same total log size. So the fluctuations in how much history is currently available at any given time are smaller. |
Codecov Report
@@ Coverage Diff @@
## develop #3891 +/- ##
========================================
Coverage 77.17% 77.17%
========================================
Files 457 457
Lines 33778 33778
========================================
Hits 26067 26067
Misses 7711 7711
Continue to review full report at Codecov.
|
I will merge this now and if there really is a need to make these values configurable, we can open a feature request issue to have support added for this through |
Fixes #3557
The logging configuration for the daemon did already include the
definition of a
RotatingFileHandler
, however, the logs were notactually being rolled over when the maximum size was hit. The problem
was because the argument
backupCount
was not defined. As the pythondocumentation of the
logging
module states:but if either of
maxBytes
orbackupCount
is zero, rollover neveroccurs, so you generally want to set
backupCount
to at least 1,and have a non-zero
maxBytes
.Setting
backupCount
to 10, fixes the problem. The size of each file isset to 10 MB. This should then keep at most 100 MB of log files for each
profile.