Web Server Rescue
Changes system stateRead Recent Container Logs
A container is failing and full logs are too large or too noisy.
Command
docker logs --since 10m --tail 100 api
Before you run this
System impact: Changes system or application state. Needs inspection, scoping, and rollback notes before production use.
When not to use it: Do not paste raw logs into public channels without reviewing them for secrets or user data.
Expected output
The last 100 log lines from the previous 10 minutes.
System impact
Changes system state. Nothing changes locally. Docker reads recent log output for one container.
Recovery / rollback: no state is changed.
When to use it
Use when checking recent crashes, startup errors, HTTP failures, or deployment regressions.
When not to use it
Do not paste raw logs into public channels without reviewing them for secrets or user data.
Watch this command run
Command transcript
This sanitized transcript shows the commands and output shape without exposing host details.
$ docker logs --since 10m --tail 100 api
2026-06-25T14:18:01Z INFO booting api
2026-06-25T14:18:03Z ERROR database connection refused
2026-06-25T14:18:05Z INFO retrying startup
$ docker logs --since 30m --tail 200 api 2>&1 | grep -i 'error\|fail\|exception'
2026-06-25T14:18:03Z ERROR database connection refused
2026-06-25T14:18:05Z fatal startup failed
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
docker logs --since 10m --tail 100 apidocker logs --since 30m --tail 200 api 2>&1 | grep -i 'error\|fail\|exception'
next steps
Related commands
Show Published Container Ports
When a service is unreachable, confirm Docker is publishing the port you think it is.
docker port web
Inspect Release Disk Usage
Disk pressure during deploys often starts in old release directories.
du -sh releases/* 2>/dev/null | sort -h | tail -10
Find Restarting Containers Fast
Restart loops hide in plain sight unless you filter for them.
docker ps -a --filter status=restarting --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}'
Check Filesystem Space with df
A full disk can break logins, uploads, databases, and deploys.
df -h
Find Large Directories with du
Once you know a filesystem is full, the next question is where.
du -xh --max-depth=1 /var 2>/dev/null | sort -h
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Useful for
- LPIC-1 style command-line practice
- LFCS style performance tasks
- Linux+ style troubleshooting review
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.