Skip to content
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

Add rotation feature to docker logs #563

Merged
merged 2 commits into from
May 6, 2017
Merged

Add rotation feature to docker logs #563

merged 2 commits into from
May 6, 2017

Conversation

qiluo-msft
Copy link
Collaborator

No description provided.

@@ -11,6 +11,7 @@ start() {
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 <wutong23@baidu.com>
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 <stephens@nvidia.com>
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