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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Run docker logs <CONTAINER> to read a container’s recorded standard output and standard error on a Linux server. Add --follow to watch new entries as they arrive, --tail 100 to limit the result to the newest 100 lines, or --since and --until to select 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.

What docker logs shows

Docker does not automatically display every file inside a container. The command reads the endpoint process’s STDOUT and STDERR through the container’s configured logging driver. Docker describes the live form this way: “The docker logs --follow command will continue streaming the new output from the container’s STDOUT and STDERR.”

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

That distinction explains many apparently missing logs. If an application writes only to /var/log/app.log inside the container and does not forward that data to standard output or standard error, docker logs will not return the file’s contents. You must either change the application’s logging destination or use the application’s own file-reading and collection method.

Quick command reference

Goal Command Result
List running containers docker ps Shows names and IDs for running containers.
Include stopped containers docker ps -a Shows running and stopped containers.
Read logs docker logs <CONTAINER> Prints available standard-output and standard-error entries.
Use the long command form docker container logs <CONTAINER> Equivalent logs operation using the object-oriented command syntax.
Follow new entries docker logs --follow <CONTAINER> Prints existing entries, then waits for new output.
Follow with the short flag docker logs -f <CONTAINER> Same live stream as --follow.
Show the newest 100 lines docker logs --tail 100 <CONTAINER> Returns a bounded snapshot from the end of the log.
Add timestamps docker logs --timestamps <CONTAINER> Prefixes entries with RFC3339Nano timestamps.
Read entries after the last hour docker logs --since 1h <CONTAINER> Uses a Go-duration time window.
Read a bounded time range docker logs --since <START> --until <END> <CONTAINER> Returns entries after the start and before the upper bound.
Include driver attributes docker logs --details <CONTAINER> Adds extra attributes supplied by logging options when configured.

Step 1: identify the container

List running containers

  1. Open a shell on the Linux server and run
    docker ps
  2. Use the NAMES value or the container ID in subsequent commands. Names are usually easier to read in scripts and incident notes; IDs are unambiguous when several containers have similar names.

Find a stopped container

A container that exited will not appear in the default listing. Include all containers:

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.
docker ps -a

Use the resulting name or ID with docker logs. A stopped container can still have retained log entries, so checking its output is often the fastest way to understand why it exited.

Step 2: retrieve a one-time snapshot

Replace <CONTAINER> with the name or ID:

docker logs <CONTAINER>

The long equivalent is:

docker container logs <CONTAINER>

This prints the entries currently available to Docker and then exits. It is the appropriate form for a quick error check, a stopped process, or a command whose output you want to redirect into another tool.

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.

For example, a bounded snapshot can be saved without leaving an interactive stream running:

docker logs --tail 100 web-api

Use the exact container name shown by docker ps or docker ps -a; a shell typo produces a container-not-found error rather than an empty log.

Step 3: follow logs live

To monitor a service while it starts or handles a request, use:

docker logs --follow <CONTAINER>

The short form is:

docker logs -f <CONTAINER>

Docker first prints retained entries and then keeps the command open, streaming new standard-output and standard-error data. Stop the stream with Ctrl+C; this stops your log-viewing command, not the container itself.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Combining follow mode with a tail limit is useful when a busy service has a large history:

docker logs --follow --tail 100 web-api

That command starts with only the newest 100 lines and then continues with arriving entries. Without --tail, the documented default is all, so Docker may print the entire retained history before the live stream begins.

Limit output by line count

Read the newest N lines

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

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

The number applies to the end of the available log, not to a particular time interval. A line-count limit is predictable when you need the latest startup messages or a compact diagnostic capture, but it does not guarantee a particular time span: a busy process may produce 100 lines in seconds, while a quiet process may take days to produce them.

Combine a tail limit with timestamps

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

This is useful when copying a short incident window into a ticket. Timestamps are emitted in RFC3339Nano format, so retain them exactly if another system will parse the output.

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

Add timestamps and driver details

Show event times

Use either spelling:

docker logs --timestamps <CONTAINER>
docker logs -t <CONTAINER>

Docker adds RFC3339Nano timestamps to each returned entry. The timestamps are Docker’s recorded event times; they are not a replacement for an application’s own structured event fields.

Request extra attributes

docker logs --details <CONTAINER>

--details asks the logging driver to include additional attributes when those attributes were supplied through logging options. If the configured driver has no such attributes, the output may look unchanged.

Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Filter logs by time

Use a relative duration

--since accepts a Go duration such as 42m:

docker logs --since 1h <CONTAINER>
docker logs --since 42m <CONTAINER>

These commands return entries after the relative start point. The same option can be combined with --follow to begin at a recent boundary and then watch new events:

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

Use an absolute start time

Docker also accepts an RFC3339 date or a Unix timestamp for --since:

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

Use the timestamp format required by your incident record and keep the server’s timezone in mind when converting a human time into an absolute value.

Set an upper bound with --until

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

--until selects entries before the specified timestamp or relative duration. Docker documents --until support for API version 1.35 and later. If a client or server reports an API compatibility error, check the Docker CLI and daemon versions before relying on an upper-bound filter.

Choose line filtering or time filtering

Need Prefer Reason
Last few messages regardless of age --tail N Predictable number of lines.
Everything since a deploy or incident start --since Matches an operational time boundary.
Only one bounded interval --since plus --until Prevents earlier or later entries from entering the capture.
Recent history followed by live events --since plus --follow Starts at a known recent point and remains attached.

Why docker logs can appear empty

The application writes to a file instead of standard streams

Docker returns the endpoint command’s STDOUT and STDERR, not arbitrary files in the container filesystem. If the process writes only to /var/log/app.log, an empty Docker result is expected. Configure the application to emit to standard output or standard error, or use its file-specific logging and collection procedure.

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

You selected the wrong container

Run docker ps for running containers and docker ps -a when the process may have stopped. Verify the name and ID before diagnosing the application.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

The container has not produced output

A healthy process can be silent. Test with follow mode while causing a known startup or request event:

docker logs --follow --timestamps <CONTAINER>

If no event is generated and the application does not log routine activity, there may simply be no stream data to display.

The logging driver does not expose readable entries

The active logging driver controls what Docker can retrieve. A driver that sends data to an external file, host, database, or other backend may provide little or no useful output through docker logs when dual logging is disabled. In that case, inspect the configured destination using the logging system’s own tools.

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

Check the container’s logging driver

Run this inspection command, replacing the placeholder:

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

The result is the logging driver configured for that container. Docker documents json-file as the default compatibility driver and also supports drivers such as local and journald. The driver setting belongs to the container configuration, so checking the daemon’s current default alone is not enough when investigating an existing container.

Use the result to choose the next diagnostic path:

  • Readable local driver: retry docker logs with the needed filters.
  • External or host-backed destination: consult that destination directly when the driver does not provide Docker-readable entries.
  • Unexpected driver: review how the container was created and whether its logging options match the server’s retention and collection design.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Understand the json-file driver and disk usage

With the json-file driver, Docker records each entry’s message, stream, and timestamp. Docker warns that these files can consume significant disk space when they are not rotated. The files under Docker’s data directory are intended to be accessed by the Docker daemon; do not treat them as ordinary application files to parse, truncate, or edit during normal operations.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Configure rotation in daemon.json

On a Linux host, add rotation settings to /etc/docker/daemon.json. This example keeps up to three files, each capped at 10 MB:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  }
}

Docker requires log-opts values in daemon.json to be strings, which is why both values are quoted. Preserve any unrelated settings already present in the file and keep the JSON valid.

Apply the daemon configuration

  1. Validate the edited JSON before restarting the service.
  2. Restart Docker on a systemd-based Linux host:
sudo systemctl restart docker

The new defaults apply to newly created containers. Existing containers retain the logging configuration they were created with, so recreate those containers when you need them to adopt the changed defaults. A daemon restart alone does not retroactively rewrite each existing container’s logging settings.

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 configuration, or cannot launch containers. For daemon-level problems on Linux, query the systemd journal:

sudo journalctl -xu docker.service

To follow new daemon messages:

sudo journalctl -fu docker.service

Depending on the distribution, related daemon messages may also appear in /var/log/syslog or /var/log/messages. Use these sources when the Docker service is failing before a container can produce logs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Question Correct source
What did the application process print? docker logs <CONTAINER>
What is the application printing right now? docker logs -f <CONTAINER>
Why did the Docker service fail to start? sudo journalctl -xu docker.service
Why is a remote logging destination missing entries? The backend or host destination configured by the container’s logging driver.

Practical investigation workflows

Investigate a failed startup

  1. List all containers: docker ps -a.
  2. Identify the exited container by name or ID.
  3. Read its complete retained output: docker logs <CONTAINER>.
  4. Repeat with --timestamps if the order or timing is unclear.
  5. Inspect the logging driver if the output is absent or unexpectedly short.

Watch a deployment

  1. Start with a bounded recent history: docker logs --tail 100 --timestamps <CONTAINER>.
  2. Attach to the live stream: docker logs --follow --timestamps <CONTAINER>.
  3. Stop viewing with Ctrl+C after the deployment event has completed.

Capture a defined incident window

  1. Establish the incident start and end in a single time standard.
  2. Use --since with the start and --until with the end.
  3. Add --timestamps so the exported lines retain Docker’s recorded times.
  4. Record the container name or ID and the driver type alongside the capture.
docker logs --since <START> --until <END> --timestamps <CONTAINER>

Inspect a noisy service without dumping its full history

docker logs --tail 200 --follow --timestamps <CONTAINER>

This gives a manageable starting context and then remains useful for interactive diagnosis.

Troubleshooting checklist

  • “No such container”: rerun docker ps -a and copy the exact name or ID.
  • Empty output from a running service: confirm the process writes to STDOUT or STDERR, then watch with --follow while generating an event.
  • Only old entries appear: check whether log rotation has removed earlier data and whether the selected driver retains logs elsewhere.
  • Time filtering gives unexpected results: verify the timestamp format, timezone, and whether your client supports the requested --until operation.
  • Disk usage keeps growing: inspect the driver and configure rotation for json-file; recreate existing containers after changing defaults.
  • Docker itself is unavailable: use journalctl -xu docker.service or journalctl -fu docker.service rather than expecting container logs to diagnose a daemon failure.
  • Driver output is missing: inspect the container’s driver with docker inspect -f '{{.HostConfig.LogConfig.Type}}' <CONTAINER> and consult the configured external destination when necessary.

Command patterns worth keeping

# Find the target, including stopped containers
docker ps -a

# Read all retained entries
docker logs <CONTAINER>

# Follow from the newest 100 lines
docker logs --tail 100 --follow <CONTAINER>

# Add RFC3339Nano timestamps
docker logs --timestamps <CONTAINER>

# Read the last hour
docker logs --since 1h <CONTAINER>

# Read a bounded interval
docker logs --since <START> --until <END> <CONTAINER>

# Include configured driver attributes
docker logs --details <CONTAINER>

# Identify the container's logging driver
docker inspect -f '{{.HostConfig.LogConfig.Type}}' <CONTAINER>

# Inspect Docker daemon messages
sudo journalctl -xu docker.service
sudo journalctl -fu docker.service

Operational limits to remember

  • docker logs is a view of container standard streams, not a universal filesystem log browser.
  • --tail limits lines, while --since and --until limit time; choose the filter that matches the question.
  • The logging driver determines whether Docker can read and display the entries.
  • Unrotated json-file logs can consume substantial disk space.
  • Changing daemon defaults affects newly created containers; recreate existing containers to apply the new logging configuration.
  • Use systemd journal commands for Docker daemon failures, not container-level output commands.

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.