journal-log-presitent(持久化保存)

journal log

1.craete dir
mkdir -p /var/log/journal
mkdir -p /etc/systemd/journald.conf.d

2.add journal config
cat /etc/systemd/journald.conf.d/99-storage.conf <<EOF
[Journal]
Storage=persistent
Compress=yes
SyncIntervalSec=5m

SystemMaxUse=1G
SystemMaxFileSize=200M
MaxRetentionSec=2week
ForwardToSyslog=no
EOF

3.restart systemd-journald
systemctl restart systemd-journald