Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the command for the docker container to access the log

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces what the docker container access log command is, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.

What is the docker container access log command?

Using the docker logs command, the docker logs [options] container can get the container's log.

-details displays additional details provided to the log

-follow or-f output by log

-since starts to be displayed at a certain time, such as 2018-06-08T13:23:37

-tail displays from how many lines at the end of the log

-timestamps or-t display timestamp

-until prints logs before a certain time, such as 2018-06-08T13:23:37

Example: view the last 10 lines of log of docker container named user-uat in real time

Docker logs-f-t-tail 10 user-uat

Example: check the log after the specified time, and only show the last 100 lines

Docker logs-f-t-since= "2018-06-08"-tail=100 user-uat

Example: check the log for the last 30 minutes

Docker logs-- since 30m user-uat

Example: check the log after a certain time

Docker logs-t-since= "2018-06-08T13:23:37" user-uat

Example: check the log for a certain period of time

Docker logs-t-since= "2018-06-08T13:23:37"-- until "2018-06-09T12:23:37" user-uat

Example: write the error log to a file

Docker logs-f-t-since= "2018-06-08" user-uat | grep error > > logs_error.txt

On the docker container access log command is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report