Recommended Free Tools
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Docker logs are read from the command line with docker logs CONTAINER. Add --tail for a short recent slice, --follow to watch new messages, --timestamps to add Docker’s timestamps, and --since/--until to isolate a time window. For orchestrated workloads, use docker compose logs for a Compose service or docker service logs for a Swarm service.
This guide shows how to find the right target, choose the correct filter, interpret what Docker can and cannot display, and diagnose an empty or incomplete result. The command behavior described here follows Docker’s current documentation checked in November 2026.
As an Amazon Associate I earn from qualifying purchases.
What does docker logs actually show?
docker logs retrieves the log output that Docker has available for a container when the command runs. In normal use, that means the container’s standard output (stdout) and standard error (stderr), rather than every file an application may write inside its filesystem. Docker’s container logs reference documents the command and its filters.
The application controls the message format and much of the content. A web server that writes access lines to stdout will expose those lines through Docker; an application that writes only to an internal file may produce little or nothing in the CLI. The configured logging driver also affects what remains available to docker logs.
Popular on Amazon
- 【90 Degree Full Function USB C Adapter】Supports the latest USB4 standard for up to 40Gbps of bandwidth, 8K video support, and up to 240W Fast charging; Support USB PD 3.1 Extended Power Range (EPR) including 140W, 180W and 240W. Your productivity is easily doubled. *Warm Tip: For the best fit, please make sure the USB-C port is fully exposed; thick or bulky cases may affect compatibility.
- 【Reliable Quality】Made from high-quality, scratch-resistant aluminum alloy, delicate metal frame. get excellent wear resistance and heat dissipation. Non-Slip Design for easier insertion and removal.
- 【Small and portable】Ultra thin size, ultra compact design, a petite physique that matches the minimalist design of your modern laptops. Coming with a slim figure that won't block the port next to the one it's plugged into.
- 【Compatibility】Widely work with most usb c, thunderbolt 4/3 devices. Compatibilit for ROG Ally, Steam Deck, Switch, MacBook Pro, Quest 3 VR headset, Surface Book 2, iPhone 18/17/16/15, Samsung Galaxy S23/S22/S21, Note 20/10, Google Pixel, ChromeBook, etc.
- 【Excellence Customer Support】If you experience any issues or cable failure, simply reach out to our dedicated customer service team. We provide a prompt response within 18 hours, providing you with the necessary technical support to resolve any concerns.
How do I read logs from one Docker container?
First identify the container, then request its output. You can use either its name or its ID.
- List running containers:
docker psFor stopped containers, include all containers:
docker ps -a - Read the target container’s available output:
docker logs CONTAINERReplace
CONTAINERwith the name or ID shown bydocker ps. - If the output is large, narrow it with one or more options described below.
Without a limit, Docker requests all available lines. That can be slow or overwhelming for a busy container, so a bounded first query is usually easier to inspect.
Which Docker log option should I use?
Each option answers a different troubleshooting question. They can be combined when the command supports the combination.
| Need | Command | Effect |
|---|---|---|
| Read everything currently available | docker logs CONTAINER |
Returns the available output when the command runs. |
| See only the newest lines | docker logs --tail 100 CONTAINER |
Returns the last 100 lines. The default is all available lines. |
| Watch new output | docker logs --follow CONTAINER or -f |
Continues streaming new stdout and stderr entries. |
| Add Docker-generated time information | docker logs --timestamps CONTAINER or -t |
Prefixes entries with Docker’s RFC3339Nano timestamp. |
| Start at a relative time | docker logs --since 30m CONTAINER |
Shows entries from the last 30 minutes. |
| Start at an exact time | docker logs --since 2026-11-23T10:00:00Z CONTAINER |
Shows entries at or after the supplied timestamp. |
| Stop at an upper time boundary | docker logs --until 2026-11-23T11:00:00Z CONTAINER |
Excludes entries after the specified boundary. |
| Display creation-time logging metadata | docker logs --details CONTAINER |
Shows extra attributes supplied through logging options, when present. |
Use a positive integer with --tail. Docker documents a negative number or a non-integer as invalid input that resolves to all, so it is not a predictable way to request a small result.
How do I see the last 100 lines?
Use:
docker logs --tail 100 CONTAINER
This is a historical snapshot, not a live stream. To begin with the last 100 lines and then continue watching new entries, combine the options:
docker logs --tail 100 --follow CONTAINER
The combination is useful during an incident because it provides immediate context without replaying the container’s entire history, then leaves the terminal attached to new output. Press Ctrl+C to stop following; this ends the CLI stream, not the container.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
How do I follow Docker logs in real time?
Add --follow (or -f):
docker logs --follow CONTAINER
Docker keeps the command running and streams subsequent stdout and stderr output. If the container has a long history, avoid replaying all of it by adding --tail or --since:
Also popular on Amazon
- 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.
docker logs --since 15m --follow CONTAINER
The second command begins at the 15-minute boundary and then waits for new entries. A follow stream is attached to the selected container only; it does not automatically switch to a replacement container created later under a different ID.
How do I add and interpret Docker timestamps?
Use --timestamps (or -t):
docker logs --timestamps CONTAINER
Docker adds RFC3339Nano timestamps and zero-pads fractional seconds so columns align. These are timestamps attached by Docker to log entries. They should not be treated as proof that the application generated the same time inside its message; an application may include a separate event timestamp in its own text.
Time filters accept relative values such as 30m and date/time values such as RFC 3339 timestamps. If a timestamp has neither Z nor a numeric offset, Docker interprets it in the Docker client’s local timezone. Add an explicit offset when commands may run on machines in different timezones:
docker logs --since 2026-11-23T10:00:00-05:00 --until 2026-11-23T10:30:00-05:00 CONTAINER
--since can be combined with --follow or --tail. Use --until when you need a closed investigation window rather than everything after a starting point.
What is a useful incident command sequence?
For a fast investigation, start narrow and widen only if necessary:
# 1. Recent snapshot with Docker timestamps
docker logs --tail 100 --timestamps my-container
# 2. Stream entries from the last 15 minutes
docker logs --since 15m --follow my-container
# 3. Inspect the equivalent Compose service window
docker compose logs --since 15m --tail 100 web
The first command is a bounded snapshot. The second follows new output while retaining a recent time boundary. The third asks Compose for output from the service named web, which is useful when the workload is managed as a project rather than as an individually named container.
How do I read logs for a Docker Compose service?
Run the command from the Compose project directory, or otherwise provide the project context expected by your Compose setup:
Free tools Windows power users keep installed
One-click scans. No signup required.
Also popular on Amazon
- 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.
docker compose logs SERVICE
Replace SERVICE with the service key from the Compose file. To inspect all project services, omit the service name:
docker compose logs
Compose supports the same practical filters used most often for a container: -f/--follow, --tail, --since, --until, and --timestamps. For example:
docker compose logs --since 15m --tail 100 --timestamps web
When a service has multiple replicas or indexed instances, use --index to select the specific container instance documented for that service:
docker compose logs --index 2 web
Without an index, Compose can show output across the service’s instances, which is useful for a fleet-wide view but can make a single replica’s failure harder to isolate. The Compose logs reference lists the current flags and their syntax.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11How do I read logs for a Docker Swarm service?
For a Swarm service, use the service-level command rather than targeting one standalone container:
docker service logs SERVICE
You can apply the command’s documented options to narrow or follow service output. There is an important limitation: Docker documents docker service logs as functional only when the service uses the json-file or journald logging driver. If the service sends records to another driver, this command may not provide the expected output. Check the Swarm service logs reference before changing a production service’s logging configuration.
Why is docker logs empty or missing messages?
An empty result does not necessarily mean the application produced no events. Work through these checks in order.
Also popular on Amazon
- Portable and powerful USB-C HUB: BENFEI USB Type-C HUB, with super-soft and knot-free silicone woven design cable, meets most mobile office needs. Compact, lightweight, stylish, and powerful portable USB C Hub equipped with 1 x HDMI port, 1 x 100W charging, and 3 x USB ports. 18-month warranty, 24-hour response, to ensure you feel at ease when using our product.
- Design centered on comfort and reliability: Thanks to BENFEI's end-to-end in-house cable production capability, in-house PCBA and assembly capability, using the industry's most advanced silicone woven design and process, 20cm cable in length, no knots, super-soft, the HUB is easy to use in all scenarios: laptop, tablet, stand etc. Super-soft, 25000+ life cycles, to meet your daily carrying and office needs.
- 100W Charging: Support up to 90W USB C pass-through charging via Type-C port to keep your laptop powered. 10W is reserved for other interface operations. No data and video function on the Type-C port.
- 4K HDMI Display: The HDMI port supports media display at resolutions up to 4K 30Hz, keeping every incredible moment detailed and ultra vivid. Please note that the C port of the Host device needs to support video output.
- Transfer Files in Seconds: Transfer files and from your laptop at speeds up to 10 Gbps with USB A 3.2 port. Extra 2 USB A 2.0 ports are perfectly for your keyboards and mouse.
- Confirm the target. Run
docker ps -aand verify the name or ID. A similarly named replacement container can have a different history. - Check the application’s output path. Docker exposes what the container emits on stdout and stderr. If the program writes to an internal log file, that file is not automatically converted into Docker log entries.
- Check the logging driver. Docker’s logging overview explains that the driver controls where records go. A driver that forwards logs to an external backend may leave the local CLI with little useful data when dual logging is disabled.
- Inspect the configured logging setup. Use the driver configuration documentation to determine what the daemon and container were configured to retain. Settings are chosen at container creation and can differ between workloads.
- For Swarm, verify driver compatibility.
docker service logsrequiresjson-fileorjournaldaccording to Docker’s service-log documentation. - Check the time filter. A mistaken timezone or an overly narrow
--since/--untilrange can exclude the entries you expect. IncludeZor a numeric offset in exact timestamps.
Do not make manually opening Docker’s internal log files your normal workflow. The CLI is the documented interface, while the driver owns storage, formatting, and rotation. Docker notes that reading rotated files may temporarily consume additional CPU and disk resources when compressed data must be decompressed; use a narrow query first.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsHow do logging drivers change what the CLI can display?
Docker’s default logging driver is json-file, but the daemon or an individual container can be configured with another driver. Driver choice determines where records are written and which retrieval paths are available. The logging-driver configuration guide describes these settings.
Some drivers send entries directly to another system. If dual logging is disabled, Docker may not retain a local copy that docker logs can return, so an empty CLI response can be an expected consequence of configuration rather than a command failure. In that case, inspect the configured backend through its own documented interface or adjust logging policy for future containers; changing a driver does not retroactively recreate records that were never retained locally.
Logging options can also attach extra attributes at container creation. When such attributes exist, --details can display them:
docker logs --details CONTAINER
Treat this as conditional metadata. It is not a general command for dumping arbitrary environment variables or every container setting.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →How should I combine filters without losing useful evidence?
Choose one starting boundary and one output-size control based on the question:
- Recent error triage:
docker logs --tail 200 --timestamps CONTAINER. - Live incident watch:
docker logs --since 10m --follow --timestamps CONTAINER. - Fixed post-incident window:
docker logs --since START --until END --timestamps CONTAINER, with explicit timezone offsets. - Large service with many replicas:
docker compose logs --tail 100 SERVICE, then add--indexafter identifying the affected instance.
Keep the original command and time boundaries with your incident notes. A later reader can reproduce the query more reliably when the container identifier, timezone, and filters are recorded together.
Also popular on Amazon
- 【Read before You Buy】 Note: This adapter is USB 2.0 version and cannot transmit HDM, VGA, or other video signals. Nevertheless, they are fully capable of charging devices,duplicating files, and can be seamlessly integrated with USB-C earphones, wireless network adapters, and SD card adapters.
- 【Easy to Use and Safe】Thanks to modern manufacturing techniques, we've made these adapters sufficiently compact so that they can remain inserted in your device without noticeable protrusion or inconvenience. This means you don't have to constantly plug and unplug them, reducing the likelihood of wear and misalignment, and making them more convenient to carry around.
- 【Reliable Quality】Engineered for enhanced durability, durable aluminum alloy shell material,get excellent wear resistance and heat dissipation,the male USB C and female USB connectors & the male USB and female USB C connectors are designed to be plugged and unplugged up to 20000 times. Provides data transfer, device charging, memory space expansion, and additional computer peripherals.
- 【Think more for you】Do you need to connect a USB-C-enabled device to an odd device that only has USB-A ports? Then these USB-A male to USB-C female adapters are made for you.Simply insert the adapter into the USB-A port on the device, and you can instantly connect your USB-C device to the device that originally didn't have the correct connection port.
- 【Trusted xiwxi Quality and Service】As a responsible brand seller, you will receive xiwxi's 12-month Quality assurance and lifetime friendly customer service, you're not just buying a product,you're investing in peace of mind with all-round quality and exceptional customer service.
What should I expect from log format and ordering?
Docker does not standardize the application’s message format. One line may be plain text, while another may be structured JSON emitted by the application. Docker’s timestamp prefix is separate from that payload. If an application writes multiline messages, the visual grouping and parsing behavior depend on the configured driver and how the application writes to stdout or stderr; do not infer fields that the application did not emit.
For cross-container diagnosis, collect timestamps from each command and use the same explicit timezone convention. Compose service output can combine multiple instances, so include the service and, when relevant, replica index in your notes.
How do I choose between container, Compose, and Swarm commands?
Target the layer that owns the workload:
| Workload | Command | Best use | Important caveat |
|---|---|---|---|
| One container | docker logs CONTAINER |
Inspect a known container name or ID. | Only output available through the configured logging setup is returned. |
| Compose project | docker compose logs SERVICE |
Inspect a service and optionally a replica index. | Run with the correct Compose project context. |
| Swarm service | docker service logs SERVICE |
Inspect service-level output across Swarm tasks. | Supported for json-file and journald drivers. |
Do not substitute a service command simply because a container happens to belong to a service. The service-level commands add orchestration context; the standalone command is the direct path when you already know the container you need.
How we selected the commands and troubleshooting advice
The workflow follows Docker’s documented interfaces: identify a target with docker ps, retrieve output with the container logs command, narrow or stream it with the documented flags, and switch to Compose or Swarm commands when those systems own the workload. The limitations and empty-output checks come from Docker’s logging overview, driver configuration guidance, and service-log compatibility notes rather than from an independent benchmark.
Docker logs quick reference
| Goal | Command |
|---|---|
| List running containers | docker ps |
| List all containers, including stopped ones | docker ps -a |
| Read one container | docker logs CONTAINER |
| Read the last 100 lines | docker logs --tail 100 CONTAINER |
| Follow from the last 100 lines | docker logs --tail 100 --follow CONTAINER |
| Follow from 15 minutes ago | docker logs --since 15m --follow CONTAINER |
| Add Docker timestamps | docker logs --timestamps CONTAINER |
| Read a Compose service | docker compose logs SERVICE |
| Select a Compose replica | docker compose logs --index 2 SERVICE |
| Read a Swarm service | docker service logs SERVICE |
Docker’s references are live documentation, so recheck the relevant command page when updating scripts for a future Docker release.
Frequently Asked Questions
Can Docker logs show an application’s internal log file?
Not automatically. The CLI exposes output made available through the container’s stdout and stderr and the configured logging driver; a file written only inside the container needs its own application or collection path.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Why do Docker timestamps not match the time printed by my application?
Docker’s --timestamps value is an entry timestamp added by Docker, while the application may print a separate event time in its message. Compare both values with the timezone and clock assumptions of the systems that produced them.
How can I follow logs without replaying a huge history?
Combine --follow with either --tail or --since. For example, docker logs --since 10m --follow CONTAINER starts at a recent boundary and then streams new entries.
What does docker logs --details reveal?
It displays extra attributes supplied through logging options when the container was created. It is conditional metadata, not a general dump of environment variables or all container configuration.
Where should I look when a service uses an external logging backend?
Check the logging driver and its configuration first. Docker notes that when logs are sent elsewhere and dual logging is disabled, the local docker logs command may have little or no useful output, so retrieval must follow the configured backend’s interface.

