Home > Operation and Maintenance > Docker > How to view docker logs

How to view docker logs

王林
Release: 2020-05-19 13:54:04
Original
5715 people have browsed it

How to view docker logs

You can view docker logs by using the docker logs command.

Command format:

docker logs [OPTIONS] CONTAINER
Copy after login

Parameter description:

-f: Trace log output

--since: Display a certain All logs at the start time

-t: Display timestamp

--tail: Only list the latest N container logs

Specific example:

View the logs after the specified time, only display the last 100 lines:

$docker logs -f -t --since="2018-02-08" --tail=100 CONTAINER_ID
Copy after login

View the logs of the last 30 minutes:

$docker logs --since 30m CONTAINER_ID
Copy after login

View the logs after a certain time:

$docker logs -t --since="2018-02-08T13:23:37" CONTAINER_ID
Copy after login

View logs for a certain time period:

$docker logs -t --since="2018-02-08T13:23:37" --until "2018-02-09T12:23:37" CONTAINER_ID
Copy after login

Recommended tutorial: docker tutorial

The above is the detailed content of How to view docker logs. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template