[action] [PR:875] bmcctld: stop teeing routine logs to /var/log/syslog - #83
Merged
Merged
Conversation
### Why i did it? Fixes: sonic-net/sonic-buildimage#28982 Fixes: sonic-net/sonic-platform-daemons#872 > - bmcctld FileHandler currently has no log rotation mechanism, making it the only unrotated writer to syslog within PMON. The write volume is low, but the log is effectively bounded only by the event rate. > - EventLogger tees every log call to DEFAULT_LOG_FILE = "/var/log/syslog" using a plain logging.FileHandler, without any maxBytes or backupCount. This path lives in PMON’s writable overlay, so the host’s logrotate cannot manage it, and PMON does not have a cron-based rotation mechanism. As a result, it is the only file in the container without any form of rotation. Since the file is append-only and persists across reboots, it can grow monotonically over the lifetime of the device. ### How i did it ? > remove the tee to /var/log/syslog rather than adding a RotatingFileHandler. EventLogger already invokes the base class before touching the file on every logging method, so the messages are already handled through the normal logging path, which would avoid maintaining a separate unrotated file ### How to verify? ``` docker exec pmon ls -la /var/log/syslog ``` <!-- Provide a general summary of your changes in the Title above --> #### Description <!-- Describe your changes in detail --> #### Motivation and Context <!-- Why is this change required? What problem does it solve? If this pull request closes/resolves an open Issue, make sure you include the text "fixes #xxxx", "closes #xxxx" or "resolves #xxxx" here --> #### How Has This Been Tested? <!-- Please describe in detail how you tested your changes. Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code, etc. --> Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com> #### Additional Information (Optional)
Collaborator
Author
|
Original PR: sonic-net/sonic-platform-daemons#875 |
Collaborator
Author
|
/azp run |
|
No pipelines are associated with this pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why i did it?
Fixes: sonic-net/sonic-buildimage#28982
Fixes: sonic-net/sonic-platform-daemons#872
How i did it ?
How to verify?
Description
Motivation and Context
How Has This Been Tested?
Signed-off-by: Sonic Build Admin sonicbld@microsoft.com
Additional Information (Optional)