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
VGSources
Blog

How to View Docker Container Logs on a Linux Server

Use docker logs to read a container’s standard output and error, follow it live, limit lines, filter by time, and troubleshoot driver or rotation problems on a Linux server.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The quickest way to read a container’s output is docker logs <CONTAINER>. Add --follow (or -f) for a live stream, --tail 100 for the last 100 lines, and --since/--until to restrict the time range. These commands show what the container process writes to standard output and standard error; they do not automatically read application log files inside the container.

What Docker container logs contain

Docker captures the endpoint process’s STDOUT and STDERR. The docker logs command reads those captured streams through the container’s configured logging driver. A game server, web service, or worker that writes status lines and errors to its console therefore appears in docker logs.

As an Amazon Associate I earn from qualifying purchases.

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.

Files such as /var/log/app.log are a separate matter. Docker does not automatically open arbitrary files in the container and merge them into the log stream. The application must write those messages to standard output or standard error, or deliberately link or redirect its file logging to one of those streams. If it only writes a file, use the application’s own file-viewing method or change its logging configuration.

Docker describes follow mode this way: “The docker logs --follow command will continue streaming the new output from the container’s STDOUT and STDERR.” Follow mode ends when you press Ctrl-C; stopping the display does not stop the container.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Before you run a log command

Confirm that the Docker CLI can reach the daemon

Run a harmless inventory command first:

docker ps

If the command reports a daemon connection or permission error, fix that access problem before diagnosing the application. On a host where your user is not allowed to access Docker’s socket, run the command with the appropriate administrative privileges for that installation, commonly sudo docker ps. Avoid adding broad permissions without understanding the security implications of Docker socket access.

Find the container name or ID

docker ps lists running containers. Include stopped containers with:

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

Use the exact name or any unambiguous ID shown in the first column. A stopped game server is easy to miss if you use only docker ps; docker ps -a also lets you inspect the output from a process that exited during startup.

Read logs once, from beginning to end

After identifying the target, request its captured output:

docker logs <CONTAINER>

The equivalent long form is:

docker container logs <CONTAINER>

Docker prints the available entries and exits. For a very busy service, an unrestricted request can produce a large amount of text, so use a tail or time filter when you need a focused incident window.

Follow a container’s logs live

To watch new entries as they arrive, use:

docker logs --follow <CONTAINER>

The short option is:

docker logs -f <CONTAINER>

Follow mode is useful while starting a service, joining a game server, loading a mod, or reproducing a crash. Existing entries are printed first, then the command waits for new standard-output and standard-error records. Press Ctrl-C to leave the stream. This only detaches your terminal from the log view; it does not send a stop signal to the container.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Limit the amount of output

Show the last 100 lines

Use the line-count option:

docker logs --tail 100 <CONTAINER>

The short spelling is -n 100. Replace 100 with the number of lines you need. Docker documents the default as all, meaning an invocation without --tail requests every retained entry. A tail is counted from the end of the retained log, not from the container’s process start time.

Combine a tail with live follow mode

To see recent context and then continue watching:

docker logs --follow --tail 100 <CONTAINER>

This is generally more practical than following an unbounded history on a busy server. The first 100 retained lines provide context; subsequent records are streamed as they are written.

Add timestamps and driver details

Print timestamps

Add RFC3339Nano timestamps with:

docker logs --timestamps <CONTAINER>

Use -t as the short form. Timestamps make it easier to correlate a container event with a host alert, a deployment, or another service’s log. You can combine them with every other normal log option, for example:

docker logs -t --tail 100 <CONTAINER>

Include logging-driver attributes

If the configured driver supplies extra attributes, request them with:

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

--details does not create new metadata. It only includes attributes made available by the logging configuration, so the amount of additional information varies by driver and its options.

Filter logs by time

Use a relative duration

To display entries from the last hour:

docker logs --since 1h <CONTAINER>

Docker accepts Go-style durations such as 42m. This is useful when investigating a restart or failed deployment without guessing an exact clock time.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Use an absolute timestamp or Unix time

--since also accepts an RFC3339 date or a Unix timestamp. For example:

docker logs --since 2026-10-15T12:00:00Z <CONTAINER>

Use the timestamp format and timezone that match the event you are investigating. An explicit UTC suffix such as Z avoids confusing a local clock reading with UTC.

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.

Set an upper boundary with --until

When you need a closed interval, add --until:

docker logs --since 2026-10-15T12:00:00Z --until 2026-10-15T12:30:00Z <CONTAINER>

The upper-bound option accepts a timestamp or relative duration. Docker documents --until support for API version 1.35 and newer. If a client or daemon is older than that API level, check the installed Docker version before relying on it.

Use time and line filters together

Options can be combined. For example, this follows only recent output while retaining a manageable initial snapshot:

docker logs --follow --since 15m --tail 100 <CONTAINER>

Use --since/--until when the incident has a known time window; use --tail when the number of recent lines is the useful boundary. They answer different questions and should not be treated as interchangeable filters.

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

Command reference

Need Command What it does
Read all retained output docker logs <CONTAINER> Prints captured standard output and standard error, then exits.
Read a stopped container docker ps -a followed by docker logs <CONTAINER> Includes containers that are no longer running.
Watch new entries docker logs -f <CONTAINER> Prints available output and keeps streaming new records.
Show the last 100 lines docker logs --tail 100 <CONTAINER> Limits the initial output to the end of the retained log.
Add event times docker logs -t <CONTAINER> Adds RFC3339Nano timestamps.
Read the last hour docker logs --since 1h <CONTAINER> Shows entries after a relative one-hour boundary.
Read a bounded interval docker logs --since <START> --until <END> <CONTAINER> Restricts output to the supplied start and end values.
Show driver attributes docker logs --details <CONTAINER> Includes extra attributes supplied by the logging driver, when configured.

Why docker logs shows nothing

The process has not written to standard output or standard error

A running container can legitimately have an empty log stream. Some applications log only to files, remain quiet until a request arrives, or buffer output. Check the application’s logging mode and its internal log location. Docker will not import a file merely because it is under /var/log.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

You selected the wrong container

Names can be similar after a deployment or restart. Re-run docker ps -a, copy the exact name or ID, and inspect the container that actually owns the process. If a compose-style deployment creates several services, query each service container separately.

The container exited before producing output

A stopped container’s logs remain queryable when its logging driver retained them. Use docker ps -a to find the exit, then run docker logs against that container. If it was removed, its local container metadata and associated logs may no longer be available.

The logging driver does not provide readable logs to the CLI

The driver determines where records are stored and whether the Docker API can return them. A driver that sends records to an external file, host, database, or other backend may return little or no useful data through docker logs, especially when dual logging is disabled. In that case, consult the configured destination rather than repeatedly increasing the tail size.

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

Output is delayed by application buffering

Some runtimes buffer console output. If a message appears only when the process exits or a buffer fills, Docker cannot display it earlier; the delay occurs before Docker receives the record. Configure the application or runtime for unbuffered or line-buffered output when timely diagnostics are required.

Check the container’s logging driver

Use Docker inspection to see the driver configured for a particular container:

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

The result identifies the driver used by that container, not merely the daemon’s current default. Docker documents json-file as the default compatibility driver and also supports drivers such as local and journald. Other drivers can route records to an external system with different retention and retrieval commands.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Driver settings belong to the container configuration. Changing the daemon’s default later does not retroactively convert existing containers. Verify the actual container before assuming that a host-wide setting explains its behavior.

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

Understand json-file storage and safe access

With the JSON-file driver, each record contains the message, the stream that produced it, 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.

Direct manipulation can break the daemon’s assumptions about file ownership, rotation, or record format. Use docker logs for reading, and configure rotation through Docker rather than deleting bytes from the storage path. If an external collector is required, configure an appropriate logging driver or collection mechanism instead of scraping daemon-managed files.

Prevent unrotated logs from filling the disk

Docker warns that unrotated JSON-file logs can consume significant disk space. Configure size and file-count limits in the Linux host’s /etc/docker/daemon.json:

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

The values under log-opts must be strings in daemon.json, including numeric-looking values such as 10m and 3. Validate the JSON syntax before restarting Docker; an invalid daemon configuration can prevent the service from starting.

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

On a systemd-based Linux host, restart the daemon with:

sudo systemctl restart docker

These defaults apply to containers created after the configuration change. Existing containers keep the logging configuration they were created with, so recreate those containers when you need them to adopt the new rotation policy. Plan that recreation around the workload’s persistence and deployment process; recreating a container is not the same as restarting its process.

Container logs versus Docker daemon logs

docker logs explains what a container process emitted. It does not explain why the Docker daemon itself failed to start, lost its socket, or rejected a host-level configuration. For daemon problems on Linux, query the systemd journal:

sudo journalctl -xu docker.service

To follow daemon messages live, use:

sudo journalctl -fu docker.service

Depending on the Linux distribution, related daemon messages may also appear in /var/log/syslog or /var/log/messages. Use those host logs when the Docker service is unhealthy, while reserving docker logs for a container’s captured application streams.

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

A practical troubleshooting sequence

  1. List the target. Run docker ps; use docker ps -a if the service may have stopped.
  2. Request a bounded snapshot. Start with docker logs --tail 100 -t <CONTAINER> so the output is readable and time-labeled.
  3. Expand the time window. Use --since for the period surrounding the failure and add --until when the incident has a known end.
  4. Reproduce while following. Run docker logs --follow --tail 100 <CONTAINER>, repeat the failing action, and stop the display with Ctrl-C.
  5. Check the logging driver. Run the inspection command and determine whether the records are local, journal-based, or sent to an external backend.
  6. Separate application and daemon failures. If Docker itself is failing, switch to journalctl -xu docker.service rather than expecting a container’s output to explain the host problem.

Choosing the right viewing approach

Approach Best for Boundary
Live stream with -f Watching startup, reproducing a fault, or monitoring a service interactively Requires an active terminal and only shows records exposed by the driver.
Bounded snapshot with --tail Quick context from a busy container Counts lines, not elapsed time; older relevant events may be outside the selected count.
Time window with --since/--until Correlating output with an incident, deployment, or alert Depends on accurate timestamps and documented API support for --until.
Container process logs Application messages emitted on standard output or standard error Does not read arbitrary files inside the container.
Docker daemon journal Startup, socket, service, and host-level Docker failures Does not replace the container log stream.
External aggregation backend Central retention, search, and logs from multiple hosts Retrieval uses the backend’s tools; docker logs may be limited when dual logging is disabled.

Operational habits that avoid surprises

  • Use docker ps -a during crash investigations so an exited container is not overlooked.
  • Start with --tail or a time window on high-volume services instead of dumping every retained record.
  • Add --timestamps when correlating a game-server event with host, network, or deployment activity.
  • Keep application diagnostics on standard output and standard error when you expect Docker-native retrieval.
  • Inspect the per-container logging driver before assuming that all hosts retain logs in the same place.
  • Configure rotation for JSON-file logging and recreate existing containers after changing daemon defaults.
  • Use the Docker daemon journal for daemon failures; container output cannot diagnose a daemon that is not running.

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 quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
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.