October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk9 min

How to View Docker Container Logs on a Linux Server

Use docker logs to read a container’s standard output and error, follow new entries live, filter by lines or time, and troubleshoot missing output by checking the logging driver and application destination.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use docker logs <CONTAINER> to read the standard output and standard error captured from a Docker container. Add --follow to watch new entries as they arrive, --tail 100 to limit the result to the newest 100 lines, and --since or --until to define a time window. If the command is empty or incomplete, check the container’s logging driver and whether the application writes to standard streams at all.

Start with the container name or ID

Docker commands require the target container’s name or ID. On a Linux server, begin with a list of running containers:

As an Amazon Associate I earn from qualifying purchases.

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

If the container has stopped, include all containers:

docker ps -a

The CONTAINER ID and NAMES columns both identify a container. You can use either value in the commands below. A short ID is normally sufficient when it uniquely identifies one container, while the name is easier to recognize in scripts and runbooks.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

For example, if the list contains a container named web, its basic log command is:

docker logs web

The long-form equivalent is:

docker container logs web

Both forms request the same container log endpoint. The command returns what the container process sent to STDOUT and STDERR; it does not automatically read every file inside the container.

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

Read a bounded snapshot of the logs

Show all available entries

Run docker logs <CONTAINER> without a line limit when you need the complete log history that the active driver makes available. Docker documents the default for --tail as all, so omitting that option requests all available lines.

docker logs web

A very large history can take time to display and can produce more output than your terminal or scrollback can comfortably handle. For an incident, a bounded query is usually easier to inspect and share.

Show only the newest N lines

Use --tail N or its short form -n N:

docker logs --tail 100 web
docker logs -n 100 web

This returns the last 100 lines currently available. Replace 100 with the number that matches the event you are investigating. A tail limit is a line-count filter, not a time filter: a busy service may produce 100 lines in seconds, while a quiet service may take days to produce them.

Add timestamps to each entry

Use --timestamps or -t when the time of an event matters:

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

Docker emits RFC3339Nano timestamps. Combining timestamps with a tail limit gives a compact, time-labelled snapshot that is useful when correlating a container event with another server or application.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Follow a container log live

To keep the command open and print new output as the container writes it, use --follow or -f:

docker logs --follow web
docker logs -f web

Docker describes this behavior as continuing to stream new output from the container’s STDOUT and STDERR. Press Ctrl+C to stop following and return to the shell; stopping the client does not stop the container.

By default, following starts with the available history and then waits for new entries. Combine it with --tail when you want only a small context window before the live stream:

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

This is often the most useful form during a restart or deployment: it shows the last 50 lines and then reveals each subsequent line without repeatedly running a command.

Filter logs by a time range

Show entries after a relative duration

--since accepts a relative duration such as 1h or an absolute date/time value. To see entries from the last hour:

docker logs --since 1h web

Docker also documents Unix timestamps and RFC3339 dates as valid forms. Relative durations are convenient for an incident that started recently; an absolute value is clearer when several people are working from a written timeline.

Set both a beginning and an end

Add --until when you need an upper boundary:

docker logs --since 2026-10-15T09:00:00Z --until 2026-10-15T09:30:00Z web

You can combine --since and --until with relative values as well. Docker documents --until support for API version 1.35 and later. If a client or daemon is older than that API level, the option may not be available.

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.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Choose a filter that matches the question

Need Command What it limits
Last 100 lines docker logs --tail 100 web Number of lines from the end
Events from the last hour docker logs --since 1h web Start time relative to now
A fixed incident window docker logs --since START --until END web Beginning and end timestamps
Live output after a small history docker logs -f --tail 50 web Initial line count, then ongoing entries

Use a line filter when volume is the problem and a time filter when the incident has a known clock interval. They answer different questions and should not be treated as interchangeable.

Use the complete option set when needed

Option Short form Purpose
--follow -f Continue streaming new entries
--tail N -n N Show N lines from the end; the documented default is all
--timestamps -t Add RFC3339Nano timestamps
--since VALUE None Show entries after a date, Unix timestamp, or Go duration such as 42m
--until VALUE None Show entries before a timestamp or relative duration; Docker documents API 1.35+ support
--details None Include extra attributes supplied through logging options

Options can be combined. For example, this command displays the last 200 lines, labels them with timestamps, and includes driver-provided attributes:

docker logs --tail 200 --timestamps --details web

--details does not invent metadata. It can show only attributes supplied by the configured logging options, so its output varies by driver and configuration.

Understand what docker logs actually reads

Container logs are the endpoint command’s standard output and standard error. A process that writes messages with normal console output is therefore visible through docker logs. Docker does not automatically search application files such as /var/log/app.log.

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

If an application writes only to a file inside the container, the file’s contents will not appear in the command output unless the application is changed to write or link that log to the container’s standard streams. This distinction explains many apparently empty results: the application may be working, but its chosen destination is not the Docker log endpoint.

Container logs and Docker daemon logs are separate sources. A failure in the Docker service itself can occur before a container starts and therefore cannot be diagnosed reliably from that container’s log stream.

Diagnose empty or missing output

Confirm that you selected the right container

Run docker ps -a and verify the name, ID, and state. A recreated container may have a new ID or name, while the old container still appears in the all-containers list. Querying the old instance can return an empty or irrelevant history.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Check whether the container produced output

An application that has not written to STDOUT or STDERR has nothing for docker logs to display. Check the application logging configuration and whether it writes to a file instead. Redirecting or linking the relevant stream to standard output/error is an application-level change; Docker cannot infer which internal file should be treated as the log.

Inspect the logging driver

The logging driver controls where Docker sends and stores log records. Display the driver configured for a specific container with:

docker inspect -f '{{.HostConfig.LogConfig.Type}}' web

Docker documents json-file as the default compatibility driver and also supports drivers such as local and journald. Other drivers can send records to an external file, host, database, or service. When a driver does not retain a readable local copy, docker logs may not show useful information, particularly when dual logging is disabled.

The practical consequence is that log availability is a driver property, not a promise that every configured backend can be queried through the same CLI command. If the driver sends data elsewhere, use that driver’s backend and retention controls for the authoritative history.

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

Do not edit Docker’s internal log files directly

With the JSON-file driver, each entry records the message, its stream, and a timestamp. Docker warns that these files are intended to be accessed by the Docker daemon. Do not treat files under /var/lib/docker/... as ordinary application logs to parse, truncate, or edit during normal operations. Use docker logs and the driver’s documented configuration instead.

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

Prevent JSON-file logs from filling the disk

Unrotated JSON-file logs can consume significant disk space. Configure rotation in the Docker daemon’s /etc/docker/daemon.json file:

{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  }
}

The values under log-opts must be strings, including numeric-looking values such as 10m and 3. On a systemd-based Linux host, restart Docker after saving a valid configuration:

sudo systemctl restart docker

These daemon defaults apply to newly created containers. Existing containers retain the logging configuration they were created with, so recreate them when you need them to adopt the new rotation settings. Plan that recreation as an operational change: it can interrupt workloads and should follow the restart or deployment procedure used by your service.

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.

Rotation limits future growth; it does not make an external retention system unnecessary. If logs must be kept longer than the local rotation window, configure an appropriate logging backend and retention policy separately.

View Docker daemon logs instead

When Docker itself fails to start, cannot create containers, or reports daemon-level errors, inspect the systemd journal for the Docker service:

sudo journalctl -xu docker.service

To follow new daemon messages live, use:

sudo journalctl -fu docker.service

Depending on the Linux distribution, related daemon messages may also be present in /var/log/syslog or /var/log/messages. These sources describe the Docker service and host integration, not the application process inside a container. Choose the source based on the failing layer: docker logs for a container process, and journalctl for the Docker daemon.

Practical command sequences

Inspect a service that just failed

  1. List stopped and running containers: docker ps -a.
  2. Read the most recent context: docker logs --tail 200 --timestamps SERVICE.
  3. Limit the query to the suspected incident window with --since and, if necessary, --until.
  4. If the output is empty, inspect the logging driver and application destination before assuming the service produced no events.

Watch a restart or deployment

  1. Identify the current container with docker ps.
  2. Start a small live context: docker logs --follow --tail 50 --timestamps SERVICE.
  3. Leave the stream running while the service starts, then stop the client with Ctrl+C when you have captured the needed output.

Investigate a Docker startup failure

  1. Use sudo journalctl -xu docker.service rather than a container log command.
  2. Follow the daemon stream with sudo journalctl -fu docker.service if the failure is recurring.
  3. Once the daemon is healthy and the container exists, switch to docker logs for application-level messages.

Choose the right viewing approach

Approach Best for Limitation
docker logs CONTAINER A complete available snapshot Can be unwieldy for high-volume containers
docker logs --tail N CONTAINER Recent context by line count Does not correspond to a fixed time period
docker logs --since ... --until ... CONTAINER Known incident windows Requires a reliable time value and supported API for --until
docker logs --follow CONTAINER Watching a live process Shows only what reaches standard output/error and remains attached until interrupted
journalctl -xu docker.service Docker daemon failures Does not replace the container’s application log
Driver-specific backend External aggregation and retention Availability and query syntax depend on the configured driver

Operational checklist

  • Use docker ps, or docker ps -a for stopped containers, before querying logs.
  • Use docker logs CONTAINER for the container’s captured standard output and standard error.
  • Use --follow for a live stream and --tail for a bounded line count.
  • Use --timestamps when correlating events with a timeline.
  • Use --since and --until for time windows; remember that --until requires Docker API 1.35 or later.
  • Use --details only when driver-provided attributes are configured.
  • Check the logging driver with docker inspect when output is missing or unexpectedly short.
  • Keep applications writing important diagnostics to standard output/error if they are expected to be visible through Docker’s log command.
  • Configure rotation for the JSON-file driver and recreate existing containers after changing daemon defaults.
  • Use the systemd journal for Docker daemon failures, not the application container’s log stream.

Frequently asked questions

Why does docker logs show nothing?

The container may not have written to standard output or standard error, the application may be writing only to an internal file, you may have selected the wrong container, or the active logging driver may not retain a readable local stream. Verify the container with docker ps -a, inspect its driver, and check the application’s logging destination.

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

How do I see the last 100 lines?

Run docker logs --tail 100 CONTAINER. Add --timestamps if you need event times.

How do I follow Docker logs live?

Run docker logs --follow CONTAINER or docker logs -f CONTAINER. Add --tail 50 to show only the last 50 existing lines before following new output.

Where are Docker daemon errors recorded?

On Linux, start with sudo journalctl -xu docker.service. To watch new daemon messages, use sudo journalctl -fu docker.service. Some distributions also use /var/log/syslog or /var/log/messages.

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.

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
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.