- Depending on the settings or your configuration
you may find that the systemd journal
is not persistent on your distribution,
but you can manage it.
Manage it through /etc/systemd/journald.conf,
and have a look at the parameter storage is auto.
If that parameter is set,
then a persistent journal will be created
after creating a directory /var/log/journal.
After making the journal persistent
you can restart your system, that's the easiest way.
After the reboot, it will be persistent.
But if you don't want to reboot
and you want it to be persistent immediately,
then you can use systemctl restart
systemd-journal-flush.service,
and that will trigger systemd
to reload the journal configuration
and create the persistent journal for you.
Let's check it out.
So first on the CentOS system I'm typing journalctl,
where you can see that the journal
was created February 21st, 8:04,
and I can tell you that was my last reboot.
So if we investigate this
/etc/systemd/journald.conf configuration file,
there you can see the storage is auto option.
So the storage is auto option is here,
we don't need to change it.
The only thing we need to do, we need to go to /var/log,
and in /var/log we need to create a sub-directory journal,
so mkdir journal.
Now the funny thing is that you might think
systemctl daemon-reload will pick it up
'cause in most cases systemctl daemon-reload
does pick it up.
But as you can see, it's not happening.
So we need systemctl restart
systemd-journal-flush.service.
And now if you use your ls on journal again,
there you can see a sub-directory has been created.
This is your persistent journal.
There's no need to worry about file size or anything,
systemd comes default parameters
that ensure that the journal
will never be able to fill up your complete file system.
So for now, we have made the journal persistent.
Let's go check out some more facts about our syslog.