Skip to content

Add rotation feature to docker logs#563

Merged
qiluo-msft merged 2 commits intosonic-net:masterfrom
qiluo-msft:qiluo/docker-log-rot
May 6, 2017
Merged

Add rotation feature to docker logs#563
qiluo-msft merged 2 commits intosonic-net:masterfrom
qiluo-msft:qiluo/docker-log-rot

Conversation

@qiluo-msft
Copy link
Collaborator

No description provided.

else

docker run -d {{docker_image_run_opt}} \
--log-opt max-size=2M --log-opt max-file=5 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2M?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maximal 5 files, each file maximal 2 MB. So in long term, the disk occupation should be 8 MB ~ 10 MB for each container.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave some comments on how the number is picked?

Copy link
Collaborator Author

@qiluo-msft qiluo-msft May 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lguohan
Copy link
Collaborator

lguohan commented May 2, 2017

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.

@qiluo-msft
Copy link
Collaborator Author

qiluo-msft commented May 2, 2017

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 qiluo-msft closed this May 2, 2017
@jleveque
Copy link
Contributor

jleveque commented May 4, 2017

@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.

@qiluo-msft
Copy link
Collaborator Author

qiluo-msft commented May 5, 2017

@jleveque I think this PR is not blocking your work. It is general for all log drivers.

@jleveque
Copy link
Contributor

jleveque commented May 5, 2017

@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.

@qiluo-msft qiluo-msft merged commit 6cab3bc into sonic-net:master May 6, 2017
@qiluo-msft qiluo-msft deleted the qiluo/docker-log-rot branch May 8, 2017 05:08
lguohan pushed a commit that referenced this pull request Jul 31, 2019
* 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)
Kalimuthu-Velappan pushed a commit to Kalimuthu-Velappan/sonic-buildimage that referenced this pull request Sep 12, 2019
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]>
madhanmellanox pushed a commit to madhanmellanox/sonic-buildimage that referenced this pull request Mar 23, 2020
add acl table created by dtel to acl default tables
stephenxs added a commit to stephenxs/sonic-buildimage that referenced this pull request Dec 14, 2021
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]>
mssonicbld added a commit that referenced this pull request Nov 21, 2024
…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
VladimirKuk pushed a commit to Marvell-switching/sonic-buildimage that referenced this pull request Jan 21, 2025
…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
mlok-nokia pushed a commit to mlok-nokia/sonic-buildimage that referenced this pull request Feb 27, 2025
…ic-swss

[submodule][202405] Update submodule sonic-swss to the latest HEAD automatically
mssonicbld added a commit that referenced this pull request May 26, 2025
… 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
mssonicbld added a commit that referenced this pull request May 28, 2025
… 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
bobby-nexthop pushed a commit to bobby-nexthop/sonic-buildimage that referenced this pull request Aug 1, 2025
bobby-nexthop pushed a commit to bobby-nexthop/sonic-buildimage that referenced this pull request Aug 1, 2025
…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]>
mssonicbld added a commit that referenced this pull request Jan 30, 2026
…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
xincunli-sonic pushed a commit to xincunli-sonic/sonic-buildimage that referenced this pull request Feb 2, 2026
…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]>
FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Mar 6, 2026
…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]>
dprital pushed a commit that referenced this pull request Mar 19, 2026
…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]>
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.

4 participants