On 22.04 LTS if I use journalctl to view the logs, I can only see entries from 48 hours ago (and while less important, journalctl --list-boots only lists the current boot).
Here's what I've checked (numbered so comments can reference):
Settings
In
journald.conf: These are all set to the Ubuntu standard defaults (see below).Nothing in
logrotate.conforlogrotate.dis set to below 4 weeks (other thanrsyslogwhich is 7 days).No systemd timers or cron jobs (either in
/etc/cron*or crontabs) are set to truncate the journal (grep -r journal /etc/cron*)
Disk space
Journald will use up to 4Gb or 10% of disk space by default. On the partition
/varis on, I have ~30G available.journalctl --disk-usageshows ~800-850G in use.The
journald.conffile is set toStorage=auto, but since/var/log/journalexists (and is populated), that means it's saving the journal to disk ("persistent"). I have set it to "persistent" explicitly and reloaded the systemd unit but it makes no difference.Perhaps there was some transient disk space issue that made
journaldtruncate, but I waited some time and it didn't come back.
Other
journalctl --verifyreports no issues.Performing a
syncfollowed by aflushmakes no change.
Comparison
I have another nearly identical machine which logs back several months (and has less disk space available).
How can I configure the journal so that I can see log entries from dates earlier than 48 hours? The machine is a production server and I would rather not schedule down time for what might be a risky operation to delete the journal and re-set it.
~$ systemd-analyze cat-config systemd/journald.conf
[Journal]
#Storage=auto
#Compress=yes
#Seal=yes
#SplitMode=uid
#SyncIntervalSec=5m
#RateLimitIntervalSec=30s
#RateLimitBurst=10000
#SystemMaxUse=
#SystemKeepFree=
#SystemMaxFileSize=
#SystemMaxFiles=100
#RuntimeMaxUse=
#RuntimeKeepFree=
#RuntimeMaxFileSize=
#RuntimeMaxFiles=100
#MaxRetentionSec=
#MaxFileSec=1month
#ForwardToSyslog=yes
#ForwardToKMsg=no
#ForwardToConsole=no
#ForwardToWall=yes
#TTYPath=/dev/console
#MaxLevelStore=debug
#MaxLevelSyslog=debug
#MaxLevelKMsg=notice
#MaxLevelConsole=info
#MaxLevelWall=emerg
#LineMax=48K
#ReadKMsg=yes
#Audit=no