How To Make Journal Logs persistent In Linux

In one of the previous studies, we learned what journald/journal and rsyslog are and how they work. In this study, we will learn how to make the journal persistent.

journal is not persistent by default. Whenever you reboot your system, the entries in the journal will be gone because the journal’s entries, by default, are in the /run directory (/run/log/journal), and the the /run directory contains only runtime data which are not persistent.

However, we can make the journal persistent. you will need to create the directory /var/log/journal and the journal will be automatically persistent, it’s been defined in the configuration file to except you make the changes otherwise on the journal configuration file (/etc/systemd/journald.conf)

Step By Step Guide On How To Make Journal Logs Persistent In Linux

1. create the directory (/var/log/journal)

[root@DRDEV1]# mkdir /var/log/journal

2. verify that it is created

[root@DRDEV1 ~]# ls -l /var/log/journal/

total 0

3. restart the journald service

[root@DRDEV1]# systemctl restart systemd-journald

4. verify again

[root@DRDEV1 journal]# ls -l /var/log/journal/

total 0
drwxr-xr-x. 2 root root 28 Nov  9 08:30 c284f20c45e7462a833612be152755ee

NOTE: journals by default will not grow larger than 10% of the filesystem it is on

Be the first to comment

Leave a Reply

Your email address will not be published.