User Tools

Site Tools


packet:bpq_logging_reduction

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
packet:bpq_logging_reduction [2026/01/08 00:12] – [Writing all linbpq packets to syslog] g5rktpacket:bpq_logging_reduction [2026/03/26 06:54] (current) g5rkt
Line 43: Line 43:
 }</code> }</code>
  
-====Newer versions of Raspberry Pi OS (i.e. Debian 12)====+====Newer versions of Raspberry Pi OS (i.e. Debian 12+)====
  
 SystemD's journald is a complex beast which works very differently to classic *nix sysloggers. All logs are stored together in binary files and queried with ''journalctl'', instead of being stored as separate files in ''/var/log''. You'll find your journal files in ''/var/log/journal'', see how big they are by running SystemD's journald is a complex beast which works very differently to classic *nix sysloggers. All logs are stored together in binary files and queried with ''journalctl'', instead of being stored as separate files in ''/var/log''. You'll find your journal files in ''/var/log/journal'', see how big they are by running
Line 71: Line 71:
  
 and optionally delete the old journal files and optionally delete the old journal files
-<code>sudo rm -rf /var/log/journal</code>+<code>sudo rm -rf /var/log/journal/*</code>
  
 There will still be some stuff ending up in /var/log - on a Debian system this will be logs from apt, dpkg etc, and other packages (ginx, mosquitto etc) by default are configured to write directly to it, but all syslogging will now be in RAM and sizes kept under control. As the syslog is in RAM rebooting the Pi / if the Pi crashes all the logs will be lost. If you want persistent log storage (for example on a Pi 5 with an NVMe SSD) then you can get some control by vacuuming / configuring journald - that's beyond the scope of "save your SD card" so there's some good reading [[https://linuxhandbook.com/clear-systemd-journal-logs/|here]] There will still be some stuff ending up in /var/log - on a Debian system this will be logs from apt, dpkg etc, and other packages (ginx, mosquitto etc) by default are configured to write directly to it, but all syslogging will now be in RAM and sizes kept under control. As the syslog is in RAM rebooting the Pi / if the Pi crashes all the logs will be lost. If you want persistent log storage (for example on a Pi 5 with an NVMe SSD) then you can get some control by vacuuming / configuring journald - that's beyond the scope of "save your SD card" so there's some good reading [[https://linuxhandbook.com/clear-systemd-journal-logs/|here]]
packet/bpq_logging_reduction.txt · Last modified: by g5rkt