In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to view the log in the Docker container. The editor thinks it is very practical, so I hope you can get something after reading this article. Let's take a look at it with the editor.
Docker attach command
The docker attach [options] container connects to the running container and prints the container's standard input, output, and error stream information locally. There are three values for options in the command:-- detach-keys,--no-stdin,--sig-proxy.
This command just enters the container terminal and does not start a new process. So when you use multiple windows to enter the container at the same time, all the windows will be displayed synchronously. If one window is blocked, the other windows can no longer operate.
You can disconnect directly with ctrl+c, but this will cause the container to exit and become stop. If you want to leave the container terminal, the container is still running. You need to use the-- sig-proxy parameter. For example:
$docker attach-sig-proxy=false mytest
Note: when using docker attach to connect to the container's standard input and output, docker uses a memory buffer of about 1MB to maximize the throughput of the application. If this buffer fills up, the speed of output or write will be affected. So to view the application log, you can use the docker logs command.
Docker logs command
The docker logs [options] container gets the log of the container.
For example, print the contents of 10 lines after the container mytest is applied.
$docker logs-tail= above "10" mytest is how to view the log in the Docker container. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.