Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk10 min

How to View Docker Container Logs and Troubleshoot Failures

A practical Docker log troubleshooting guide covering stdout and stderr, live tailing, empty output, logging drivers, event timelines, daemon diagnostics, and log rotation.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start with the container’s standard output and standard error: docker logs --tail 100 CONTAINER. Add --follow while reproducing the problem. If that output is empty or does not explain the failure, check where the application writes logs, which Docker logging driver the container uses, the container’s lifecycle events, and finally the Docker daemon’s own logs.

This sequence separates application failures from logging-configuration problems and from Docker Engine or host failures. It also prevents a common mistake: assuming that docker logs reads every log file inside the container. It does not.

As an Amazon Associate I earn from qualifying purchases.

What docker logs actually displays

Docker’s log command displays the output written by the container’s main process to standard output (stdout) and standard error (stderr), much as that output would appear if the process were run interactively. The command is therefore a view of the container endpoint command, not a general-purpose search through the container filesystem.

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

Replace CONTAINER with a name or ID. The command can read output from a running container and from a container that has stopped, as long as its configured logging system still retains that output.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • 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.

Application files are a separate logging path

An application may write diagnostics to files such as /var/log/app.log instead of stdout or stderr. Those messages can exist inside the container while docker logs shows little or nothing. Docker does not automatically discover and read arbitrary files.

Some official images illustrate the alternative pattern. The nginx image routes access and error output to /dev/stdout and /dev/stderr; the httpd image is configured to write through /proc/self/fd/1 and /proc/self/fd/2. These are examples of configuring an application to use the container streams, not a universal instruction to replace every application’s file-based logging.

A reliable first pass

1. Identify the right container

A surprisingly large number of “missing log” incidents come from querying a similarly named container, an old deployment, or only the currently running set.

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

docker ps lists running containers. docker ps -a also includes exited containers, which is essential when a process failed immediately after startup. Copy the exact name or ID from that list.

2. Read a bounded amount of recent output

docker logs --tail 100 CONTAINER

The value 100 is a practical sample size, not a Docker default. Increase it when the startup sequence is longer, or reduce it when the container emits very large messages. Looking at the tail first keeps the terminal usable and focuses attention on the most recent failure.

3. Stream output while reproducing the problem

docker logs --follow CONTAINER

--follow keeps the command attached and prints new stdout and stderr records as they arrive. Start it before sending the request, restarting the process, or running the operation that fails. Stop the stream with Ctrl-C; stopping the viewing command does not by itself stop the container.

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 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.

For a long-running container, combine both options so the stream begins with useful context and then remains live:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
docker logs --follow --tail 100 CONTAINER

4. Check whether the process exited

If the container is absent from docker ps, use docker ps -a and inspect the final output from the exited instance. A short log followed by an exit often indicates a startup configuration error, an unavailable dependency, an invalid command, or a permission problem. A restart policy may create a loop in which each new instance has only a small amount of output, so capture logs while watching the lifecycle events described later.

When logs are empty or unhelpful

An empty stream has several distinct causes. Work through them in order rather than immediately changing the daemon configuration.

Confirm that the application writes to Docker’s streams

First establish the application’s logging destination. If it writes only to files, inspect the application’s own configuration and the files inside the container, or change the application setup so diagnostic output is sent to stdout and stderr when that is appropriate for the image and deployment. Docker can only display what reaches the container’s output streams through its logging path.

Inspect the container’s logging driver

Show the driver selected for this particular container:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
docker inspect -f '{{.HostConfig.LogConfig.Type}}' CONTAINER

Then show the daemon’s default driver:

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

These values can differ. The daemon default is applied when a container is created, but a container-specific setting can override it. Always inspect the container you are troubleshooting instead of assuming that the current daemon default describes older containers.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • 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.

Understand the consequences of none

The none logging driver makes container logs unavailable through docker logs. If the application writes to stdout and stderr but the container uses this driver, the output is not retained for the Docker log command.

Account for remote drivers and dual logging

Drivers that send output to a file, system journal, remote host, database, or another backend may not provide a useful local stream through docker logs. Whether the command remains useful depends on the driver and whether dual logging is enabled. In a remote-driver setup, look at the configured destination as well as the Docker CLI.

Container and service log commands

Single container

Use docker logs when one container is the unit you need to diagnose. It is the fastest way to compare startup output, a request-time error, and the final message before an exit.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Swarm service

When the workload is a service with multiple participating containers, use:

docker service logs SERVICE

This command presents logs from containers participating in the named service. It is more suitable than selecting one task when replicas can move, restart, or fail independently. You still need to correlate messages with the affected task and its lifecycle if only one replica is unhealthy.

Use events to explain timing and restart loops

Container output tells you what the process reported. Events tell you what Docker observed around it. Watch events for a specific container with:

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • 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
docker events --filter 'container=NAME_OR_ID'

The stream can reveal start, die, restart, health_status, and oom events. Begin the command before reproducing the failure so the event order is visible, then compare timestamps and messages with the output from docker logs --follow.

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

The Docker CLI reference limits the returned event history to the most recent 256 events. A high-frequency workload can therefore push an older failure out of the available window. If the incident is important, save the event stream while investigating rather than relying on a later query.

Reading common event patterns

  • die without a subsequent stable run: the process exited; inspect the final container output and its startup command.
  • Repeated start and die events: the container is likely in a crash or restart loop. Capture one complete cycle and check whether the restart policy is masking the original error.
  • health_status changes: the process may still be running while its health check fails. Compare the health-check condition with application output; a failed health check is not identical to a process exit.
  • oom: Docker recorded an out-of-memory event. Application logs may end abruptly because the process was terminated before it could print a final diagnostic.

Separate an application failure from a Docker daemon failure

If Docker commands work but the container is unhealthy, begin with the container and service steps above. If the CLI cannot communicate with Docker at all, the problem is at the daemon or host layer and container logs may be inaccessible.

Check daemon reachability

docker info

A successful response confirms that the CLI can query the daemon. If it fails, check the host’s Docker service state and verify that the DOCKER_HOST environment variable points to the intended, reachable daemon. An unexpected remote endpoint can make a healthy local installation appear empty, while an unreachable endpoint produces connection errors instead of container output.

Consider host-level resource exhaustion

Docker documents memory exhaustion as a separate troubleshooting path. An out-of-memory condition can affect the daemon, the container, or both. Correlate host symptoms, container events, and daemon messages instead of treating every abrupt container exit as an application bug.

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

Where to read Docker daemon logs

Daemon logs are distinct from container logs. Their location depends on the operating system, Docker distribution, and service setup.

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 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.

Linux

For a systemd-managed Docker service, start with:

journalctl -xu docker.service

Distributions that do not use the same journal setup may place service messages in distribution-dependent system log files. If the command returns little information, check how the host’s service manager stores Docker logs and whether the daemon is actually running under that service unit.

Docker Desktop on macOS and Windows with WSL 2

Docker documents daemon and virtual-machine service messages in a multiplexed init.log. The exact location is tied to the Desktop installation and platform, so use the Desktop troubleshooting or diagnostic interface to locate the current file rather than assuming a Linux path.

Windows containers

For Windows containers, Docker documents Windows Event Log as the relevant host-side source. Use the Windows event tools to inspect service and daemon errors when container output does not explain startup or connectivity failures.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose and audit the logging driver

Docker supports drivers that keep logs locally or forward them elsewhere. The right choice depends on where operators need to read the data, retention and rotation requirements, platform availability, and the operational burden of the destination.

Driver or destination Where output is sent What to check when docker logs is unhelpful Operational concern
json-file JSON-formatted files on the Docker host Inspect the container’s driver and local retention settings It is the default for compatibility, but has no log rotation by default and can consume host disk space
local Docker-managed local files using an efficient format Confirm the local driver is enabled for the container and review its rotation settings Docker recommends it for other situations because it rotates by default and is designed to reduce overhead and disk use
journald The host’s system journal Read the journal and verify whether dual logging is configured Retention and access follow host journal policy
syslog A syslog destination Inspect the configured syslog endpoint and host collector Availability and retention depend on the syslog service
fluentd A Fluentd collector Check collector connectivity and its stored records Network and collector availability affect delivery
awslogs An AWS logging destination Check the configured AWS log group, stream, permissions, and delivery status Requires the target platform and credentials to be available
splunk A Splunk endpoint Inspect the Splunk index or endpoint configuration Retention, connectivity, and service access are external to Docker
gcplogs A Google Cloud logging destination Inspect the configured cloud log resource and delivery permissions Cloud availability and retention policies apply

These drivers are destinations, not a requirement to use any particular hosted service. A forwarded setup should have an explicit retention policy, access control, and a documented fallback for when the remote destination is unavailable.

Rotation and disk use

Docker documents json-file as the default and notes that it does not rotate logs by default. Unbounded container output can therefore fill the host filesystem. Docker recommends the local driver in other situations because it rotates by default and uses a more efficient format.

The local-driver documentation describes a default retention of 100 MB per container, based on five rotated files of 20 MB each. Treat those figures as version- and configuration-sensitive defaults: verify the current Docker documentation and your daemon configuration before relying on them for capacity planning.

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

Changing the daemon default is not retroactive

Changing the daemon’s default logging driver affects newly created containers. Existing containers retain the logging configuration selected when they were created. To adopt a new default, recreate the affected containers through the same deployment process that owns them, then verify the result with docker inspect.

A repeatable failure-troubleshooting playbook

  1. Record the target: copy the exact container name or ID from docker ps -a.
  2. Capture recent output: run docker logs --tail 100 CONTAINER and save the result with the incident notes.
  3. Reproduce live: run docker logs --follow --tail 100 CONTAINER while repeating the failing action.
  4. Verify the output path: determine whether the application emits to stdout/stderr or only to files.
  5. Verify the driver: compare docker inspect -f '{{.HostConfig.LogConfig.Type}}' CONTAINER with docker info --format '{{.LoggingDriver}}'.
  6. Check lifecycle evidence: watch docker events --filter 'container=NAME_OR_ID' for exits, restarts, health changes, and OOM events.
  7. Escalate to the daemon: if Docker commands cannot connect or the event stream indicates host trouble, inspect docker info, the host service state, DOCKER_HOST, resource conditions, and platform-appropriate daemon logs.
  8. Correct retention deliberately: choose a driver and rotation policy that match the host and compliance requirements, then recreate containers if the driver must change.

Common mistakes to avoid

  • Looking only at running containers: an exited container will not appear in docker ps; use docker ps -a.
  • Assuming a quiet stream means a quiet application: file-based application logs and a nonlocal driver can both hide output from docker logs.
  • Changing the daemon default and expecting old containers to change: container logging settings are fixed at creation time until the container is recreated.
  • Reading only the final line: a restart loop may require several cycles of output and events to reveal the first failure.
  • Ignoring retention: the default json-file behavior can consume host disk space when rotation is not configured.
  • Using container logs to diagnose a dead daemon: when the CLI cannot reach Docker, move to host service checks and daemon logs.

What to remember

docker logs is the correct first command because it exposes stdout and stderr from the container’s endpoint process. It is not a universal file viewer. Empty output requires a check of the application’s logging destination and the selected driver, while unexplained exits require event correlation. When Docker itself cannot be reached, investigate the daemon and host using platform-specific tools. Finally, treat logging-driver selection and rotation as part of operations: a setting that works for a new container does not silently retrofit existing ones, and an unrotated default can eventually exhaust disk space.

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.

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.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.