Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use docker logs

Shulou Source: shulou.com Published: 2022-05-31 20:15:00 10月05日 Update

Editor to share with you how to use docker logs, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

$docker logs-- helpUsage: docker logs [OPTIONS] CONTAINERFetch the logs of a container-f,-- follow Follow log output-- help Print usage-- since Show logs since timestamp-t,-- timestamps Show timestamps-- tail=all Number of lines to show from the end of the logs

For example:

Docker logs-f-t-since= "2017-05-31"-- tail=100 container_name

-- since: this parameter specifies the start date of the output log, that is, only logs after the specified date are output.

-f: view real-time logs

-t: view the date on which the log was generated

-tail=100: view the last 100 logs.

Container_name: container name or ID of the container is also fine

The above is all the contents of this article "how to use docker logs". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Logs dates articles content containers output not much examples parameters names most real-time more knowledge industry information channels channels references learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Microsoft MariaDB Shulou Tech Info Shulou Information