Log entries for the systemd-journald service, which is at the heart of the logging architecture in Red Hat Enterprise Linux (RHEL), do not persist across reboots.
This means entries are wiped after a reboot, so you won't have historical data for analysis. However, with a little configuration, you can keep log entries even after a reboot.
Keep system journals after a reboot
The process involves creating a storage location (probably in /var/log) and then editing the journald configuration to direct messages to that location.
Create a storage directory
First, create a journal directory under the /var/log directory:
[server]$ sudo mkdir /var/log/journal
Edit the journald.conf file
Edit the file /etc/systemd/journald.conf and set the Storage parameter to persistent (it is set to auto by default):
[server]$ sudo vim /etc/systemd/journald.conf
[Journal]
Storage=persistent
[...]
[ How are your text editor skills? Read up on Vim and Nano competencies to find out. ]
Restart systemd-journald
Next, restart the systemd-journald service:
[server]$ systemctl restart systemd-journald
Reboot the server
Finally, reboot the server to confirm the persistence of entries by listing the /var/log/journal content. You should have output that looks similar to this:
[server]$ ls /var/log/journal
75ab164a278e48be9cf80d80716a8cd9
Wrap up
The logging capabilities of systemd-journald are critical, but the default configuration does not preserve these logs. Having data to analyze is vital when troubleshooting or profiling your system. Use this simple configuration to keep your system journals for as long as you need them.
[ Free download: Advanced Linux commands cheat sheet. ]
Sobre el autor
I work as Unix/Linux Administrator with a passion for high availability systems and clusters. I am a student of performance and optimization of systems and DevOps. I have passion for anything IT related and most importantly automation, high availability, and security.
Más como éste
Slash VM provisioning time on Red Hat Openshift Virtualization using Red Hat Ansible Automation Platform
Red Hat Ansible Automation Platform: Measuring Business Impact with Dashboard and Analytics
Technically Speaking | Taming AI agents with observability
You Can’t Automate Expectations | Code Comments
Navegar por canal
Automatización
Las últimas novedades en la automatización de la TI para los equipos, la tecnología y los entornos
Inteligencia artificial
Descubra las actualizaciones en las plataformas que permiten a los clientes ejecutar cargas de trabajo de inteligecia artificial en cualquier lugar
Nube híbrida abierta
Vea como construimos un futuro flexible con la nube híbrida
Seguridad
Vea las últimas novedades sobre cómo reducimos los riesgos en entornos y tecnologías
Edge computing
Conozca las actualizaciones en las plataformas que simplifican las operaciones en el edge
Infraestructura
Vea las últimas novedades sobre la plataforma Linux empresarial líder en el mundo
Aplicaciones
Conozca nuestras soluciones para abordar los desafíos más complejos de las aplicaciones
Virtualización
El futuro de la virtualización empresarial para tus cargas de trabajo locales o en la nube