Configure logging
Description
In this guide, you will learn how to configure systemd-journald to limit disk usage and automatically remove old log entries.
We are using the Linux operating system Ubuntu 24.04.
What you’ll learn
Step by step guide
Bash
# Step 1: Open the journald configuration
nano /etc/systemd/journald.conf
# Step 2: Add or modify the following settings and save them
SystemMaxUse=200M
SystemKeepFree=100M
SystemMaxFileSize=50M
MaxRetentionSec=7day
MaxLevelStore=warning
2. Restart journald
# Step 3: Restart the service:
systemctl restart systemd-journald