owntracks / quicksetup

A (mostly) automated installer for OwnTracks Recorder, Frontend with MQTT and Let's Encrypt
https://owntracks.org/booklet/guide/quicksetup/
15 stars 4 forks source link

Do we take care of all growing logfiles? #14

Closed ckrey closed 9 months ago

ckrey commented 9 months ago

Where do ot-recorder logs end up (systemd in debian)? I think this is handled by systemd mosquitto and nginx use logrotate There is another log /var/log/php8.2-fpm.log ...

jpmens commented 9 months ago

On Debian, Recorder messages are fed to the systemd journal, whereas on Ubuntu I noticed them in /var/log/syslog. I believe is is standard configuration on these OS.

systemd's journal grows automatically, but it is capped:

By default the maximum use limit (SystemMaxUse) is 10% of the filesystem, and the minimum free space (SystemKeepFree) value is 15% - though they are both capped at 4G.

from and official journald.conf documentation.

jpmens commented 9 months ago

/etc/logrotate.d/mosquitto: has size 100k daily. File is currently

29M /var/log/mosquitto/mosquitto.log

ah:

$ dpkg -l | grep logro

Adding package to our installer as it can't really hurt.

Running logrotate -v indicates it would be rotated:

considering log /var/log/mosquitto/mosquitto.log
Creating new state
  Now: 2024-02-20 15:36
  Last rotated at 2024-02-20 15:00
  log needs rotating
rotating log /var/log/mosquitto/mosquitto.log, log->rotateCount is 7

As php-fpm log is tiny and hasn't been touched in 12 days, I'm ignoring it.

$ du -sh /var/log/php8.2-fpm.log
4.0K    /var/log/php8.2-fpm.log