-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[rsyslog]Setting log file size to 16Mb #9504
Conversation
Signed-off-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>
@lguohan could you please approve this fix? |
i think we will have issue when disk size is small, can this be a template? keep 1M for disk size /var/log partition less than 200MB. |
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
@dgsudharsan Do we need any 'default' configuration before the logrotate config was rendered? Have you confirmed that the next logrotate will pick up the new config after rendering? Can you also add a sonic-mgmt test for this? |
Yes I tested this scenario logrotate picks up after rendered. Its only few seconds difference between cron and rendering.
Regarding sonic-mgmt, I don't think there are any test cases although the suite covers logrotate as a utility for all existing tests. |
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
@dgsudharsan thanks for the details. Yes please track a different effort and add a sonic-mgmt test. |
/azp run |
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list. |
Signed-off-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>
/azpw run |
/AzurePipelines run |
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list. |
/azpw run Azure.sonic-buildimage (Test kvmtest-t0) |
/AzurePipelines run Azure.sonic-buildimage (Test kvmtest-t0) |
No pipelines are associated with this pull request. |
/azpw run Azure.sonic-buildimage |
/AzurePipelines run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
Why I did it The existing log file size in sonic is 1 Mb. Over a period of time this leads to huge number of log files which becomes difficult for monitoring applications to handle. Instead of large number of small files, the size of the log file is not set to 16 Mb which reduces the number of files over a period of time. How I did it Changed the size parameter and related macros in logrotate config for rsyslog How to verify it Execute logrotate manually and verify the limit when the file gets rotated. Signed-off-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>
…12599) - Why I did it Fix logrotate firstaction script to reflect correct size. The size was modified to change dynamically based on disk size. However this variable was not updated #9504 - How I did it Updated the variable based on disk size - How to verify it Verify in the generated rsyslog file if the variable is correctly generated from jinja template
…12599) - Why I did it Fix logrotate firstaction script to reflect correct size. The size was modified to change dynamically based on disk size. However this variable was not updated #9504 - How I did it Updated the variable based on disk size - How to verify it Verify in the generated rsyslog file if the variable is correctly generated from jinja template
Signed-off-by: Sudharsan Dhamal Gopalarathnam sudharsand@nvidia.com
Why I did it
The existing log file size in sonic is 1 Mb. Over a period of time this leads to huge number of log files which becomes difficult for monitoring applications to handle.
Instead of large number of small files, the size of the log file is not set to 16 Mb which reduces the number of files over a period of time.
How I did it
Changed the size parameter and related macros in logrotate config for rsyslog
How to verify it
Execute logrotate manually and verify the limit when the file gets rotated.
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)