Enabling systemd-journald logging service on Raspberry Pi

September 6, 2020 - Reading time: ~1 minute

I have installed systemd on my Pi, since then I have found that there has been zero logging from May (it is now September) in syslog. I have discovered on the Pi, systemd was configured to have a non persistent logging facility. It seems that /etc/systemd/systemd-journald.conf is default commented out thus causing the logging to be non persistent and in /var/run/journal/ directory.

This is an issue when running a server, especially since mine has ssh exposure.

in order to change this you need to add Storage=persistent

This will add a directory called /var/log/journal/ where all journals are stored.

A reboot and all should be good. I did a bit different, I also created the journal directory before the reboot by

sudo mkdir -p /var/log/journal

sudo systemd-tmpfiles --create --prefix /var/log/journal

Now I have the following files in journal -->

drwxr-sr-x+ 2 root systemd-journal 4096 Sep  6 07:50 d3e79edd79094236b577249849bfdb93

which is proof it is working.

LazyCoderOZ

I am a Linux guy, been around for 20+ years using Linux as my daily driver.
This is my blog on my discoveries and notes so I don't forget how I have done things :)