Add rotation feature to docker logs#563
Add rotation feature to docker logs#563qiluo-msft merged 2 commits intosonic-net:masterfrom qiluo-msft:qiluo/docker-log-rot
Conversation
| else | ||
|
|
||
| docker run -d {{docker_image_run_opt}} \ | ||
| --log-opt max-size=2M --log-opt max-file=5 \ |
There was a problem hiding this comment.
Maximal 5 files, each file maximal 2 MB. So in long term, the disk occupation should be 8 MB ~ 10 MB for each container.
There was a problem hiding this comment.
leave some comments on how the number is picked?
There was a problem hiding this comment.
I just want to set the maximal log size for each container to 10 MB. Then overall it will be ~100 MB on a switch.
Then I choose 2M * 5, so there is at least 8M log in long running. If choosing 5M * 2, then the log size will fluctuate between 5M ~ 10M, which is not so good if you need more history.
|
should we log all of them to the syslog and keep none of them. syslog Writes logging messages to the syslog facility. The syslog daemon must be running on the host machine. |
|
Pushed new commit to resolve conflicting with --log-driver argument. To answer @lguohan question, if docker logs are ready to be moved to host syslog, we will use 'syslog' as docker log driver, ie. there is no docker logs at all, no need to rotate. Otherwise, the default docker driver will be 'json-file', and the default size limitation is no limitation, which is the problem we are trying to solve in this PR. |
|
@qiluo-msft: I'm currently working on a PR that will change all docker ENTRYPOINTs to run supervisord. Once this is tested and merged, I believe we should change all docker log drivers to 'syslog,' and eliminate the need to rotate more logs. I think we should hold off on merging this PR until we see what things look like at that point. |
|
@jleveque I think this PR is not blocking your work. It is general for all log drivers. |
|
@qiluo-msft: No, it wouldn't block my work. However, part of my PR is to consolidate process logs from inside docker containers to syslog. I just figured we could skip this PR and change the docker log driver to syslog also. It's up to you whether you want to merge this and revisit it again later. |
* src/sonic-utilities ee56d54...cb0e745 (11): > sonic_utilities: Support for DOM Threshold values for EEPROM dump (#545) > [portstat] Fix portstat show RX_UTIL over 100% for 100G (#563) > sonic_installer: fix read-only filesystem support for firmware update (#565) > Revert "show acl table command output should show binding column correctly even with single port (#447)" (#589) > show acl table command output should show binding column correctly even with single port (#447) > [config] Do no stop or restart dependent services (#582) > sfpshow: prevent 'show int trans eeprom --dom' from crashing (#567) > [warm-reboot] add docker upgrade --warm option and roll back support (#559) > [ecnconfig] Validate input WRED parameters (#579) > [sonic-utilities] Add fstrim to reboot (#535) > Fixing the expected neighbor command due to change in output format under sonic-buildimage/pull/3036 (#584)
When calc the RX_UTIL, currently it use hardcode 40G, now change to get the real port speed via APP DB Signed-off-by: Richard Wu <[email protected]>
add acl table created by dtel to acl default tables
54879741 [202012][schema] Add vnet route tunnel and advertise network tables for state_db (sonic-net#563) a5394f9d Update for BFD, default route table (sonic-net#550) Signed-off-by: Stephen Sun <[email protected]>
…D automatically (#20878) #### Why I did it src/sonic-platform-daemons ``` * b276e41 - (HEAD -> master, origin/master, origin/HEAD) [SmartSwitch] Extend implementation of the DPU chassis daemon. (#563) (9 hours ago) [Oleksandr Ivantsiv] ``` #### How I did it #### How to verify it #### Description for the changelog
…D automatically (sonic-net#20878) #### Why I did it src/sonic-platform-daemons ``` * b276e41 - (HEAD -> master, origin/master, origin/HEAD) [SmartSwitch] Extend implementation of the DPU chassis daemon. (sonic-net#563) (9 hours ago) [Oleksandr Ivantsiv] ``` #### How I did it #### How to verify it #### Description for the changelog
…ic-swss [submodule][202405] Update submodule sonic-swss to the latest HEAD automatically
… automatically (#22594) #### Why I did it src/sonic-platform-common ``` * b0cda7e - (HEAD -> master, origin/master, origin/HEAD) [sonic-platform-common] catch exception while creating api object (#569) (4 days ago) [Junchao-Mellanox] * 6738bcd - Fix KeyError for unsupported applications in get_host_lane_assignment_option() (#566) (4 days ago) [Tomer Shalvi] * 159a56a - Update ubuntu version in azure pipeline (#572) (4 days ago) [Vasundhara Volam] * b76fdb8 - (origin/202505) Added LPO media interface code (#568) (10 days ago) [Prince George] * 5ffb76c - [cmis] combine cmis eeprom i2c read (#563) (13 days ago) [Jianyue Wu] * ca7c79b - [cmis] add a parameter to cmis.set_lpmode to ignore the time wait (#564) (2 weeks ago) [Junchao-Mellanox] ``` #### How I did it #### How to verify it #### Description for the changelog
… automatically (#22662) #### Why I did it src/sonic-platform-common ``` * b76fdb8 - (HEAD -> 202505, origin/202505) Added LPO media interface code (#568) (12 days ago) [Prince George] * 5ffb76c - [cmis] combine cmis eeprom i2c read (#563) (2 weeks ago) [Jianyue Wu] * ca7c79b - [cmis] add a parameter to cmis.set_lpmode to ignore the time wait (#564) (2 weeks ago) [Junchao-Mellanox] ``` #### How I did it #### How to verify it #### Description for the changelog
…evice is in detaching mode (sonic-net#546) * Skip logging the warning, if device is in detaching mode * Add detach_info table and unittests * Fix unit tests * Increase code coverage * Remove unused header import * Fix dict get values * Increase code coverage * Increase test coverage * [SmartSwitch] Extend implementation of the DPU chassis daemon. (sonic-net#563) * Addition of DPU Chassis for thermalctld (sonic-net#564) * [stormond] Added new dynamic field 'last_sync_time' to STATE_DB (sonic-net#535) * Added new dynamic field 'last_sync_time' that shows when STORAGE_INFO for disk was last synced to STATE_DB * Moved 'start' message to actual starting point of the daemon * Added functions for formatted and epoch time for user friendly time display * Made changes per prgeor review comments * Pivot to SysLogger for all logging * Increased log level so that they are seen in syslogs * Code coverage improvement * [lag_id] Add lagid to free_list when LC absent for 30 minutes (sonic-net#542) When LC is absent for 30 minutes, the database cleanup kicks in. When LagId is released, it needs to be appended to the SYSTEM_LAG_IDS_FREE_LIST This PR works with the following 2 PRs: sonic-net/sonic-swss#3303 sonic-net#20369 Signed-off-by: mlok <[email protected]> * Fixed bug in chassisd causing incorrect number of ASICs in CHASSIS_STATE_DB (sonic-net#560) Fixed the bug in chassisd due to which incorrect number of ASICs were being pushed to CHASSIS_STATE_DB. * thermalctld: Add support for fans on non-CPU modules (sonic-net#555) * thermalctld: Add support for fans on non-CPU modules * Add module fan to unit tests * Advanced Azure pipeline to Bookworm (sonic-net#572) Description This PR advances the azure pipeline on sonic_platform_daemons from bullseye to bookworm. This fixes the issue where sonic-platform-daemons azp is having some issues due to upgrade to bookworm. See Pipelines - Run 20241210.8 logs for details. * Take non-CMIS xcvrs out of lpmode in SFF Manager (sonic-net#565) Description Fix non-CMIS transceivers in down state by bringing them out of low power mode in the SFF Manager Task. This is intended to work together with the change in sonic-net#20886. Motivation and Context Non-CMIS transceivers were not functioning correctly when put into Low Power mode. So XCVRD now brings them out of lpmode. How Has This Been Tested? Loaded an image containing this change alongside the change from sonic-net#20886 on an Arista chassis containing a Clearwater2 linecard. Verified that without this image some interfaces were in a down state but with the image all interfaces came up as expected. * Added SmartSwitch support in chassisd and enabling chassisd (sonic-net#467) Added SmartSwitch support in chassisd and enabling chassisd * [chassis][psud] Move the PSU parent information generation to the loop run function from the initialization function (sonic-net#576) Description Move the PSU parent information generation to the loop run function from the initialization function Motivation and Context Fixes sonic-net#575 How Has This Been Tested? Tested on Cisco chassis, the PHYSICAL_ENTITY_INFO|PSU * can be re-inserted after thermalctld restart. And monitored the stated db for memory for hours, works well: * [chassisd] Address the chassisd crash issue and add UT for it (sonic-net#573) Description On Nokia platform, slot name of Supervisor is string "A" instead of a number. Using "int" to convert it could cause issue backtrace. We should use slot value to any checking without any conversion. This will fixes sonic-net#21131 Motivation and Context Modify the _get_module_info not to convert "slot" to a string value. And also modify the code not to convert slot value to an to do any checking. Just directly use the returned value of get_slot(). Also add UT test_moduleupdater_check_slot_string() to valid it. How Has This Been Tested? Tested on 202405 branch Signed-off-by: mlok <[email protected]> * Fix a comment --------- Signed-off-by: mlok <[email protected]> Co-authored-by: Oleksandr Ivantsiv <[email protected]> Co-authored-by: Gagan Punathil Ellath <[email protected]> Co-authored-by: Ashwin Srinivasan <[email protected]> Co-authored-by: Marty Y. Lok <[email protected]> Co-authored-by: Vivek Verma <[email protected]> Co-authored-by: Patrick MacArthur <[email protected]> Co-authored-by: Peter Bailey <[email protected]> Co-authored-by: rameshraghupathy <[email protected]> Co-authored-by: Jianquan Ye <[email protected]>
…lly (#25241) #### Why I did it src/sonic-gnmi ``` * 803f624 - (HEAD -> master, origin/master, origin/HEAD) [ssw][ha] use ProducerStateTable for DASH_HA_ tables. (#563) (6 days ago) [Jing Zhang] * af32b5b - Support for OC-YANG target for dialout telemetry (#558) (9 days ago) [Anukul Verma] ``` #### How I did it #### How to verify it #### Description for the changelog
…lly (sonic-net#25241) #### Why I did it src/sonic-gnmi ``` * 803f624 - (HEAD -> master, origin/master, origin/HEAD) [ssw][ha] use ProducerStateTable for DASH_HA_ tables. (sonic-net#563) (6 days ago) [Jing Zhang] * af32b5b - Support for OC-YANG target for dialout telemetry (sonic-net#558) (9 days ago) [Anukul Verma] ``` #### How I did it #### How to verify it #### Description for the changelog Signed-off-by: Xincun Li <[email protected]>
…lly (sonic-net#25241) #### Why I did it src/sonic-gnmi ``` * 803f624 - (HEAD -> master, origin/master, origin/HEAD) [ssw][ha] use ProducerStateTable for DASH_HA_ tables. (sonic-net#563) (6 days ago) [Jing Zhang] * af32b5b - Support for OC-YANG target for dialout telemetry (sonic-net#558) (9 days ago) [Anukul Verma] ``` #### How I did it #### How to verify it #### Description for the changelog Signed-off-by: Feng Pan <[email protected]>
…lly (#25241) #### Why I did it src/sonic-gnmi ``` * 803f624 - (HEAD -> master, origin/master, origin/HEAD) [ssw][ha] use ProducerStateTable for DASH_HA_ tables. (#563) (6 days ago) [Jing Zhang] * af32b5b - Support for OC-YANG target for dialout telemetry (#558) (9 days ago) [Anukul Verma] ``` #### How I did it #### How to verify it #### Description for the changelog Signed-off-by: dprital <[email protected]>
No description provided.