Investigate Logs and Configure Rotation
Pull the useful signal out of the journal, then keep an application's own log file from growing forever without losing the records it already holds.
Skill labintermediate~35 minPro
What you'll do
- ✓Query the journal by unit, priority and time window
- ✓Understand why a file-writing daemon must be told when its log was rotated
- ✓Write a logrotate rule with retention, compression and a reopen action
- ✓Force a rotation with a separate state file and confirm new events land in the new file
Lab outline
- 01The journal
- 02The log file
Before you start
- Operate systemd Services
- Create and Harden a Custom systemd Service
Every lab runs on a real machine of your own in the browser — no installs, nothing to clean up — and checks your work automatically as you go.