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
1
# Step 1: Open the journald configuration2
nano /etc/systemd/journald.conf3
4
# Step 2: Add or modify the following settings and save them5
SystemMaxUse=200M6
SystemKeepFree=100M7
SystemMaxFileSize=50M8
MaxRetentionSec=7day9
MaxLevelStore=warning10
2. Restart journald11
12
# Step 3: Restart the service:13
systemctl restart systemd-journald