Skip to content

[action] [PR:875] bmcctld: stop teeing routine logs to /var/log/syslog - #83

Merged
mssonicbld merged 1 commit into
Azure:202608from
mssonicbld:cherry/msft-202608/875
Aug 14, 2026
Merged

[action] [PR:875] bmcctld: stop teeing routine logs to /var/log/syslog#83
mssonicbld merged 1 commit into
Azure:202608from
mssonicbld:cherry/msft-202608/875

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator

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

Description

Motivation and Context

How Has This Been Tested?

Signed-off-by: Sonic Build Admin sonicbld@microsoft.com

Additional Information (Optional)

### 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)
@mssonicbld

Copy link
Copy Markdown
Collaborator Author

Original PR: sonic-net/sonic-platform-daemons#875

@mssonicbld

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@mssonicbld
mssonicbld merged commit 19a5b75 into Azure:202608 Aug 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant