Find a command/
中文
☰

← Back to overviewAll commands

03 / FIELD NOTES

Where a service writes its logs

Read logs for containers and systemd services, and follow them live.

Why this way

Containers log to Docker, system services log to the journal. Knowing which one to ask saves guessing, and the first error line usually names the cause.

When to use

An app restarts in a loop, shows a blank page, or stopped after an update.

Prerequisites

  • root or sudo
  • Replace komari and ssh with your container or service

Steps

All containers, including stopped ones

Read-only
docker ps -a --format 'table {{.Names}}\t{{.Status}}'

Expect: "Restarting" or "Exited (1)" points to the container to inspect.

Recent container logs

Read-only
docker logs --tail 100 komari

Expect: Add -f to keep following. Press Ctrl+C to stop.

Logs for a systemd service

Read-only
journalctl -u ssh -n 50 --no-pager

Expect: Use -f to follow, or --since "1 hour ago" to narrow the time range.

What it changes

Read-only. Logs may contain tokens or IPs; check before sharing them.