How to increase size of syslog in /var/log before it rotates and how to alter the rotation schedule ?
I am on Ubuntu 16.04.4 LTS and my syslog never seems to go past 1MB before it rotates and goes into syslog.1 and logs there. I've tried to alter the conf file like so
Code:
cat /etc/logrotate.d/rsyslog Code:
syslog.1 syslog.2.gz syslog.3.gz syslog.4.gz syslog.5.gz syslog.6.gz syslog.7.gz Code:
cat /etc/logrotate.d/rsyslog |
so if your final setting is this-
Code:
/var/log/syslog 1.It basically means rotate and keep 7 files (so 7 rotations before a syslog file gets deleted). 2.Rotate Only if the size grows bigger than 50M 3. Here comes a conflict. Rotate daily. So what happens if your logs do not reach 50M in a day ? 4.if the a log is missing, don't fret and rotate the next file. 5. Dont rotate if the logfile is of 0 size. 6. postpones compression of previous log to the next cycle. [which is why you see syslog.1 and syslog.2.gz] 7. #6 only works when you enable compression. you have commented compress out. 8. postrotate/endscript -> execute this command between these directives. I suggest using either of #3 or #4, whatever you prefer. Log rotation based on size OR log rotation based on time. Quote:
Further reading - here. Also, after modifying your settings, do a dry run with verbosity. [#logrotate -d -v] Hope it helps. |
I noticed in your steps, step #4 (the missing log ) and step #5
Quote:
Additional information perhaps can help diagnose this issue, I noticed these errors Quote:
Quote:
Quote:
|
Quote:
Either that, or put something like this inside the postrotate/endscript Code:
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true |
as to the error with 'LimitNOFILE=16384', I have no idea. Maybe somebody else can pick it up and assist.
|
Quote:
Quote:
|
Sorry mate, this was from a CentOS 6 VM. A quick web search should point you to relevant place in your Ubuntu setup.
|
if ubuntu supports the 'pidof' command, then you can possibly use that as well.
Code:
[anirban@AB-Cent7OS ~]$ sudo cat /var/run/syslogd.pid |
All times are GMT -5. The time now is 09:44 PM. |