擅长:python、mysql、java
<p>我使用它的一个变体来活尾(--跟踪)所有日志,并指出当时哪个日志在跟踪。这个bash包括stdout和stderr。注意:之后可能需要清除*.log,err}的/tmp目录</p>
<pre><code>for c in $(docker ps -a --format="{{.Names}}")
do
docker logs -f $c > /tmp/$c.log 2> /tmp/$c.err &
done
tail -f /tmp/*.{log,err}
</code></pre>
<p>希望这有帮助。这些天来伐木问题越来越严重,其他的“离开我的草坪”老人咆哮着</p>