Back to commands

Web Server Rescue

Read-only, can be slow

Read 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: Read-only. Can create load on large logs, directories, filesystems, or process tables.

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

Read-only, can be slow. Nothing changes locally. Docker reads recent log output for one container.

Scope this to the smallest useful path or service on busy systems.

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.

Sensitive output warning

Container logs can include tokens, URLs, user data, and internal hostnames. Redact before sharing.

  1. docker logs --since 10m --tail 100 api

next steps

Related commands

Linux Survival Basics Can be slow

Read Recent Docker Container Logs

Recent container logs usually show the failing command or dependency.

docker logs --tail 80 container_name
Web Server Rescue Read-only

Show Published Container Ports

When a service is unreachable, confirm Docker is publishing the port you think it is.

docker port web
Web Server Rescue Can be slow

Inspect Release Disk Usage

Disk pressure during deploys often starts in old release directories.

du -sh releases/* 2>/dev/null | sort -h | tail -10
Web Server Rescue Can be slow

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}}'

next diagnostic step

Where to go from this command

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.

  • LPIC-1 style command-line practice
  • LFCS style performance-task practice
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.