RamLog option #2 & location of persistent logs

where can i config “ramlog #2” to write logs to a mounted usb stick so i can have persistent logs written there instead of default ~/logfile_storage?

also i read where systemd-journal daemon will write to /var/log/journal if i create that dir. where can i config systemd-journal to store logs to mounted usb stick and not /var/log/journal ?


You can generally solve it by placing symlinks to the default log locations pointing to the external drive. Just be sure to copy existing logs via cp -a, so permissions and pre-created dirs are preserved.

Not sure currently about systemd. Check out /etc/systemd/journald.conf (or similar) where all available settings are listed.

thanks for the reply.

well, i tried symlinking /root/logfile_storage/ to /mnt/usb1/root.

i thought ‘ln -s’ would create the “logfile_storage” dir in /mnt/usb1/root/ but i couldn’t get it to work. symlinks work with dir’s, yes? /mnt/usb1/ is formatted as ext4. i’ll try again later today.

The following should work, based in initial setup:

mkdir /mnt/usb1/root
mv /root/logfile_storage /mnt/usb1/root/
ln -s /mnt/usb1/root/logfile_storage /root/logfile_storage

that worked!!

thank you!