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

  1. 01The journal
  2. 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.

← All Linux System Administration labs

Your first machine is
8 seconds away.

Learn by doing on real machines — and give every AI agent one of its own.

Free forever · No credit card · Cancel anytime

Investigate Logs and Configure Rotation — Linux lab | Kube Labs