Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
containers

How to Check Docker Logs: Containers, Compose, Swarm, and the Docker Daemon

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 -f to stream new output, --tail 100 to limit the display to the last 100 lines, or --since 30m to inspect a recent time window. Use docker compose logs for a Compose application, docker service logs for a supported Swarm service, and daemon logs when the problem is with Docker itself rather than an application.

Check logs for one container

Docker retrieves container logs from the container’s standard output and standard error streams. The basic command displays the available output when you run it:

docker logs my-container

Replace my-container with the container name or ID. The expanded equivalent is docker container logs. For example:

docker container logs my-container

The command shows all available lines by default. If the container is still running, this is a snapshot, not a live feed. Choose one or more options to make the output easier to use.

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

Follow new output as it arrives

docker logs --follow my-container

-f is the short form of --follow. The command keeps streaming new stdout and stderr output until you stop it, typically with Ctrl+C. Following is useful when reproducing an error or watching startup; combine it with a tail limit to avoid printing a large backlog first:

docker logs --follow --tail 100 my-container

Limit the number of lines

docker logs --tail 100 my-container

--tail N displays the last N lines. The default is all. Use a positive integer for a specific limit; a negative or non-integer value is invalid and is treated as all, so it will not reliably limit output.

Add timestamps

docker logs --timestamps my-container

-t is the short form of --timestamps. Docker adds timestamps to log lines. This can help correlate container output with another service’s events or with the time an issue occurred. Docker formats these timestamps as RFC3339Nano.

Filter by time

--since accepts a relative Go duration, Unix timestamp, or RFC3339 timestamp. For example, show output from the last 30 minutes:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
docker logs --since 30m my-container

To set a specific interval, use --until as an end time:

docker logs --since '2026-09-29T09:00:00Z' --until '2026-09-29T10:00:00Z' my-container

The date and time above are an example; substitute the interval you need. You can also use durations such as 1m30s or 3h with --since. Include Z for UTC or an explicit timezone offset in a timestamp. If a timestamp has neither, Docker uses the Docker client’s local timezone. The documented --until option is available from API 1.35 and later.

Choose the command for your Docker target

The right command depends on whether you need one container’s output, an application managed by Compose, a Swarm service, or Docker’s own runtime logs.

Target Command What it shows
One container docker logs <container> That container’s stdout and stderr.
Compose application docker compose logs Output from Compose services, optionally limited to named services.
Swarm service or task docker service logs <SERVICE|TASK> Logs for a service or a particular task, subject to Swarm logging support.
Docker daemon or runtime Operating-system-specific command or log location Docker engine and runtime diagnostics, not application-container output.

View Docker Compose logs

Run this from the Compose project directory:

docker compose logs

To focus on one service, append its service name as defined in the Compose configuration:

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

Compose accepts options for following output, limiting lines, timestamps, and time filtering as well. For example:

docker compose logs --follow --tail 100 web

When a service has multiple replicas, --index can select a replica. Use --no-color to remove color formatting or --no-log-prefix to omit Compose’s service prefixes. Omit service names to view output for the application’s services rather than narrowing the request to one service.

View Docker Swarm service or task logs

docker service logs my-service

Run docker service logs on a Swarm manager node. Selecting a service includes its containers; selecting a task narrows the output to that task. This command is functional only for services started with the json-file or journald logging driver. If it does not return the output you expect, check the service’s logging driver and whether you are running the command on a manager.

View Docker daemon logs

Daemon logs are a separate diagnostic target from container logs. Use them when Docker itself, the engine, or logging infrastructure appears to be failing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Linux: Docker documents journalctl -xu docker.service. Depending on the distribution, daemon messages may also appear in /var/log/syslog or /var/log/messages.
  • Docker Desktop on macOS: The documented VM log is ~/Library/Containers/com.docker.docker/Data/log/vm/init.log.
  • Docker Desktop on Windows with WSL2: The documented VM log is %LOCALAPPDATA%Dockerlogvminit.log.
  • Windows containers: Check Windows Event Log.

Docker Desktop’s init.log includes a component field that can help identify which service, such as dockerd or containerd, produced a message. Paths and available diagnostic interfaces can vary with operating system and Docker Desktop setup.

Why Docker logs may be empty or incomplete

An empty result does not necessarily mean the application produced no output. Check the target and logging configuration before changing the application.

Confirm the container and logging driver

First check that the name or ID points to the intended container. Then inspect the logging driver. Docker’s default is json-file, but the daemon default or a per-container setting can change it. Docker supports several drivers, including none, local, json-file, syslog, and journald. With none, docker logs has no output.

docker info --format '{{.LoggingDriver}}'
docker inspect -f '{{.HostConfig.LogConfig.Type}}' my-container

The first command reports the daemon’s default driver; the second inspects a container’s configured driver. A container can have a different driver from the daemon default.

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

Check whether output is being sent to stdout or stderr

docker logs reads the container’s stdout and stderr. If an application writes its logs only to a file inside the container, those entries are not automatically the same as Docker-managed container output. Check the application’s logging configuration and the location it writes to.

Account for remote drivers and dual logging

Docker describes dual logging as a local cache mechanism that can make docker logs available when a remote logging driver is in use. It is not a guarantee that every remote log will be present locally: a network issue can prevent a cache write, and Docker logs a failed cache write in the daemon logs without retrying it. The default cache uses a ring buffer, so some older output may be lost. When investigating remote logging, check both the remote destination and the Docker daemon logs.

Recreate containers after changing the default

Changing the daemon’s default logging configuration does not automatically change the logging driver of existing containers. Docker says to restart the daemon for default changes to take effect, and to recreate containers so they are created with the new setting. Verify the driver on the container you are troubleshooting rather than assuming a changed default already applies.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose and configure log retention

The logging driver affects where output goes, whether docker logs can read it, and how much local disk it can consume. Docker identifies json-file as the default driver. Without rotation, its files can grow until they use excessive disk space. Docker recommends configuring rotation for json-file or using local, which rotates by default and uses a format optimized for performance and disk use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Docker Container Linux Devops Programming Coding T-Shirt
  • Docker, Docker Swarm, Docker Compose, Programmer, Developer, Coding, Programming, Software Engineer, Code, DevOps, Deploy, Deployment, Kubernetes, Salt, Puppet, Chef, Terraform, Container, AWS, Azure, Cloud, Geek, Funny, Computer, Software, Tech, IT
  • Integration, Scrum, Compile, Compilation, Science, Bug, Debug, Python, Linux, Java, Javascript, Scala, Dotnet, Kotlin
  • Lightweight, Classic fit, Double-needle sleeve and bottom hem

Understand the local driver’s defaults

The documented local driver default preserves 100 MB of messages per container: five files with a default maximum size of 20 MB each. It compresses rotated files automatically. Its documented options are max-size, max-file, and compress; their defaults are 20m, 5, and enabled, respectively. The files are intended for exclusive access by the Docker daemon, so reading or modifying them directly with external tools can interfere with logging.

Inspect or set logging configuration

To set a daemon-wide default, configure log-driver and, if needed, log-opts in daemon.json. For example, this configuration selects the local driver and makes its rotation settings explicit:

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

Log option values in daemon.json must be strings, including numeric and Boolean values. After changing daemon defaults, restart Docker; then recreate containers that should use the new settings. Docker Desktop users make daemon configuration changes through the Docker Engine settings interface. For json-file, configure rotation rather than assuming its files will remain small.

Troubleshooting checklist

  • No output at all: Confirm the container name or ID, then inspect its logging driver. A container using none cannot provide output through docker logs.
  • Only some recent lines appear: Check for a --tail limit, retention or rotation, and—if using a remote driver—whether the local dual-logging cache has discarded older messages.
  • Nothing updates while watching: Use --follow. Also confirm the application writes to stdout or stderr, rather than only to a file inside the container.
  • The time window looks wrong: Add Z or a timezone offset to explicit timestamps. Without one, Docker interprets the timestamp in the client’s local timezone.
  • Compose output is too broad: Add the service name. If several replicas exist, use --index where applicable.
  • Swarm logs do not work: Run the command on a manager node and check whether the service uses json-file or journald.
  • Logs stopped after a configuration change: Check daemon logs for cache-write failures or other engine messages. Confirm the container was recreated after changing the daemon’s default driver.

Or skip the browser setup

For website screenshots—not Docker logs—ScreenshotNeo provides a one-request screenshot API. For a screenshot of a public page, replace the example URL as needed:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed. Its MCP server offers take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots. Learn more at ScreenshotNeo, or sign up free for 1,000 screenshots a month with no card.

Frequently Asked Questions

Can I use a container ID instead of its name with docker logs?

Yes. The command accepts the container name or ID.

Does docker logs show files created inside the container?

Not automatically. It retrieves stdout and stderr; application logs written only to an in-container file are a separate output source.

Can I request timestamps and a time range together?

Yes. Combine --timestamps with --since or --until when the displayed timestamps and bounded interval are both useful.

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.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Read next

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.