openhab / openhabian

openHABian - empowering the smart home, for Raspberry Pi and Debian systems
https://community.openhab.org/t/13379
ISC License
818 stars 251 forks source link

Minimize system logging #1780

Closed mstormi closed 1 year ago

mstormi commented 1 year ago

to reduce risk of ZRAM running full, max size of /var/log/* logs should be limited/reduced

TODO: (info for Ubuntu, is this filename valid for Raspi OS, too?) To limit the size of /var/log/syslog, you have to edit the /etc/rsyslog.d/50-default.conf, and set a fixed log size. see https://askubuntu.com/questions/184949/how-do-i-limit-the-size-of-my-syslog

edit/replace /etc/logrotate.d/rsyslog with a version that has a default or a line saying size 100k for all relevant logfiles (syslog, kern.log, daemon.log, other?) like so

/var/log/syslog
{
    rotate 7
    size 100k
    daily
    missingok
    notifempty
    delaycompress
    compress
    postrotate
        /usr/lib/rsyslog/rsyslog-rotate
    endscript
}
mstormi commented 1 year ago

forgot that logs except the current one already get zipped by distro / log4j2