-
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
[System logs]: Eliminate duplicate log messages and attempt rotation more frequently #520
Changes from all commits
27e610b
364c945
c8e435d
3817db5
21b08c2
6304f9d
7b0dd39
9bfaf4f
88e58d6
c7e075c
7c02b86
6ccd0d6
de4552b
ea8e998
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Attempt to rotate system logs once per minute | ||
* * * * * root /usr/sbin/logrotate -f /etc/logrotate.d/rsyslog | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/var/log/syslog | ||
/var/log/quagga/*.log | ||
/var/log/teamd.log | ||
{ | ||
rotate 7 | ||
# Removed 'daily' interval, as we now call logrotate more frequently via cron | ||
# and we want to check these logs every time | ||
# daily | ||
size 100M | ||
missingok | ||
notifempty | ||
compress | ||
delaycompress | ||
postrotate | ||
invoke-rc.d rsyslog rotate > /dev/null | ||
endscript | ||
} | ||
/var/log/mail.info | ||
/var/log/mail.warn | ||
/var/log/mail.err | ||
/var/log/mail.log | ||
/var/log/daemon.log | ||
/var/log/kern.log | ||
/var/log/auth.log | ||
/var/log/user.log | ||
/var/log/lpr.log | ||
/var/log/cron.log | ||
/var/log/debug | ||
/var/log/messages | ||
{ | ||
rotate 4 | ||
weekly | ||
size 100M | ||
missingok | ||
notifempty | ||
compress | ||
delaycompress | ||
sharedscripts | ||
postrotate | ||
invoke-rc.d rsyslog rotate > /dev/null | ||
endscript | ||
} | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Quagga rules | ||
|
||
if $programname == ["quagga", | ||
"watchquagga", | ||
"zebra"] | ||
then { | ||
/var/log/quagga/zebra.log | ||
stop | ||
} | ||
|
||
if $programname == "bgpd" then { | ||
/var/log/quagga/bgpd.log | ||
stop | ||
} | ||
|
||
## Teamd rules | ||
|
||
if $programname contains "teamd_" then { | ||
/var/log/teamd.log | ||
stop | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This file is part of systemd. | ||
# | ||
# systemd is free software; you can redistribute it and/or modify it | ||
# under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation; either version 2.1 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# See journald.conf(5) for details | ||
|
||
[Journal] | ||
#Storage=auto | ||
#Compress=yes | ||
#Seal=yes | ||
#SplitMode=uid | ||
#SyncIntervalSec=5m | ||
#RateLimitInterval=30s | ||
#RateLimitBurst=1000 | ||
SystemMaxUse=50MB | ||
#SystemKeepFree= | ||
#SystemMaxFileSize= | ||
RuntimeMaxUse=50MB | ||
#RuntimeKeepFree= | ||
#RuntimeMaxFileSize= | ||
#MaxRetentionSec= | ||
#MaxFileSec=1month | ||
#ForwardToSyslog=yes | ||
#ForwardToKMsg=no | ||
#ForwardToConsole=no | ||
#ForwardToWall=yes | ||
#TTYPath=/dev/console | ||
#MaxLevelStore=debug | ||
#MaxLevelSyslog=debug | ||
#MaxLevelKMsg=notice | ||
#MaxLevelConsole=info | ||
#MaxLevelWall=emerg | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to comment all entries out of this file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is how John originally added the file. He only intended to take advantage of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm good with this. Thanks |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this?
Does SONiC emits all these types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
*.*
on line 5 catches all messages and logs them to /var/log/syslog. Then, all messages that matchcron.*
,daemon.*
etc. are logged again to their respective files. I commented out the individual files so that all messages are only logged once, to /var/log/syslog.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see