Home >Operation and Maintenance >Docker >How to view docker logs
You can view docker logs by using the docker logs command.
Command format:
docker logs [OPTIONS] CONTAINER
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
View the logs of the last 30 minutes:
$docker logs --since 30m CONTAINER_ID
View the logs after a certain time:
$docker logs -t --since="2018-02-08T13:23:37" CONTAINER_ID
View logs for a certain time period:
$docker logs -t --since="2018-02-08T13:23:37" --until "2018-02-09T12:23:37" CONTAINER_ID
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!