Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a single container, run docker logs <container>. Add --follow for a live stream, --tail to limit history, and --since/--until for a time window. The correct command depends on whether you are examining a container, a Compose service, a Swarm service, or Docker itself.

Check logs for one container

Docker reads the container’s standard output and standard error streams with either command form:

docker logs <container>
docker container logs <container>

Replace <container> with a name or ID from docker ps. The command returns the logs available when it runs; it does not automatically remain attached.

Stream new output

docker logs --follow <container>

-f is the short form of --follow. Press Ctrl+C to stop following; this stops the log view, not the container.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Limit the number of lines

docker logs --tail 100 <container>

--tail N shows the final N lines. If you omit it, Docker uses all. A negative or non-integer value is invalid and is treated as all.

Add timestamps or extra attributes

docker logs --timestamps <container>
docker logs --details <container>

-t is the short form of --timestamps. Timestamps are emitted in RFC3339Nano format. --details includes extra attributes configured through logging options; it does not create details that the logging driver never stored.

Filter Docker logs by time

Use --since for a starting point and --until for an ending point:

docker logs --since 30m <container>
docker logs --since '2026-09-29T09:00:00Z' --until '2026-09-29T10:00:00Z' <container>

--since accepts RFC3339 timestamps, Unix timestamps, and Go durations such as 1m30s or 3h. --until returns entries before the specified time and is available from API 1.35. A timestamp without Z or an explicit UTC offset is interpreted in the Docker client’s local time zone, which can produce surprising results on remote hosts. Use Z for UTC or include an offset such as +02:00.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Useful combinations

# Last 200 lines, then continue following new entries
docker logs --tail 200 --follow <container>

# Errors from the last ten minutes, with timestamps
docker logs --since 10m --timestamps <container>

# A fixed UTC incident window
docker logs --since '2026-09-29T09:00:00Z' --until '2026-09-29T09:15:00Z' <container>

Check logs for Docker Compose

Compose groups output by service. From the directory containing your Compose file, run:

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
docker compose logs
docker compose logs web
docker compose logs --follow --tail 100 web

Omit service names to view all services, or name one or more services to narrow the output. When a service has replicas, --index selects a particular replica. Presentation options include:

  • --no-color removes ANSI colors, useful when redirecting output to a file.
  • --no-log-prefix removes the service and replica prefix.
  • --timestamps, --since, --until, --tail, and --follow provide the same kind of filtering used for a container.

For example:

docker compose logs --no-color --since 1h api > api-last-hour.log

Check Swarm service and task logs

Run this command on a Swarm manager:

docker service logs <SERVICE>
docker service logs --follow --tail 100 <SERVICE>
docker service logs <TASK>

A service selection includes its containers across the service. Selecting a task narrows the view to that task. docker service logs is functional only for services started with the json-file or journald logging driver. If the service uses another driver, inspect that driver’s destination instead.

Container logs versus Docker daemon logs

docker logs shows application output written to a container’s stdout and stderr. It does not show why the Docker engine failed, why a logging cache could not be written, or why a container could not start. Those are daemon-level questions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Linux daemon logs

journalctl -xu docker.service

Some distributions also place daemon messages in /var/log/syslog or /var/log/messages.

Docker Desktop daemon logs

On macOS, Docker documents the Desktop VM log at ~/Library/Containers/com.docker.docker/Data/log/vm/init.log. Windows with WSL2 uses %LOCALAPPDATA%Dockerlogvminit.log. Windows containers use Windows Event Log. Desktop’s init.log includes a component field that can identify services such as dockerd and containerd.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Why docker logs is empty or incomplete

Verify the target

List running containers and include stopped ones when necessary:

docker ps
docker ps -a

Copy the exact name or ID. A newly recreated container has a different ID and its own log history.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Inspect the logging driver

The daemon default can be checked with:

docker info --format '{{.LoggingDriver}}'

For one container, inspect its configured type:

docker inspect -f '{{.HostConfig.LogConfig.Type}}' <CONTAINER>

The default driver is json-file, but Docker also supports local, none, syslog, journald, and other drivers. With none, docker logs has no output by design. Remote drivers may require a local cache for the command to work; if a cache write fails, Docker records the failure in daemon logs and does not retry that write. The default remote cache is a ring buffer, so older entries can be lost.

Remember when configuration changes apply

Changing the default in daemon.json does not retroactively change existing containers. Restart Docker after changing daemon configuration, then recreate containers so they receive the new default. In daemon.json, logging option values must be strings, including numbers and booleans. Docker Desktop users edit daemon settings through the Docker Engine settings interface.

Retention, rotation, and disk usage

The json-file driver is the default, but unrotated files can eventually fill the host disk. Configure rotation or use the local driver for common non-Kubernetes installations. Docker’s local driver rotates by default and is optimized for disk use and performance.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Local driver defaults

The local driver preserves 100 MB of messages per container by default: five files with a maximum size of 20 MB each. Rotated files are compressed. Its documented options are max-size, max-file, and compress, whose defaults are 20m, 5, and enabled. The files are intended for exclusive Docker-daemon access; reading or modifying them directly can interfere with logging.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Example daemon configuration

{
  "log-driver": "local",
  "log-opts": {
    "max-size": "20m",
    "max-file": "5",
    "compress": "true"
  }
}

Save this as the daemon configuration used by your installation, restart Docker, and recreate containers. Confirm the effective driver with docker info; a running container keeps the driver it was created with.

A practical investigation workflow

  1. Identify scope. Decide whether the issue concerns one container, a Compose service, a Swarm service/task, or the Docker daemon.
  2. Confirm identity. Run docker ps -a and use the current name or ID.
  3. Start narrow. Run docker logs --tail 100 --timestamps <container>.
  4. Set a time window. Add --since and, for a fixed incident interval, --until.
  5. Reproduce while following. Use --follow and trigger the failing request or job.
  6. Check the driver. If output is absent, inspect the container and daemon logging-driver settings.
  7. Inspect daemon output. Look for cache-write, startup, storage, or engine errors in daemon logs.
  8. Check retention. If older entries disappeared or disk use is high, review rotation and driver limits.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common errors and fixes

“No such container”

The name is wrong, the container was removed, or a Compose project generated a different name. Use docker ps -a; for Compose, run the command from the correct project directory and specify the service name.

Logs stop unexpectedly

The container may have exited, or the process may have stopped writing to stdout and stderr. Check docker ps -a and inspect the exit state. For live output, ensure --follow is present.

Only recent entries are available

Rotation, a remote driver’s ring-buffer cache, or container recreation may have removed older data. Check the destination configured by the driver and the daemon logs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Time filtering returns nothing

Check the client’s local timezone interpretation. Add Z or an explicit offset, and verify that the requested interval overlaps the container’s lifetime.

Swarm command is unavailable or empty

Run it on a manager and verify that the service uses json-file or journald. Other drivers require reading their configured destination.

Or skip the browser setup

If you need a clean screenshot of a Docker-hosted dashboard, log viewer, or incident page rather than terminal text, ScreenshotNeo can capture a URL through one GET request. Its cleanup step accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. It also provides an MCP server for Claude, Cursor, and other MCP clients.

cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://your-docker-dashboard.example -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://your-docker-dashboard.example"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://your-docker-dashboard.example' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

See the ScreenshotNeo documentation for authentication and options. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

FAQ

Can I view logs from a stopped container?

Yes. If the container still exists, docker logs <container> reads its retained output even after the process exits.

Does Docker log everything printed by an application?

No. The command reads stdout and stderr captured by the configured logging driver. Applications that write only to internal files require inspecting those files or exporting them separately.

Is json-file always the best driver?

Not universally. It is the default, while Docker recommends considering local for common non-Kubernetes use because it rotates automatically. Remote destinations may be preferable when centralized retention is required.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.