title: Redirect docker logs to file
body: <p>Normally when I redirect my docker log to a text file, all the content will store in the output file. </p>
  
  <p>This is what I expected outcome</p>
  
  <pre><code>[root@ip-xx-xx-xx-xx ~]$ docker logs aa46e7139ce5 &gt; docker.log
  [root@ip-xx-xx-xx-xx ~]$
  </code></pre>
  
  <p>But sometimes the output will become following and the errors are not included in the docker.log</p>
  
  <pre><code>[root@ip-xx-xx-xx-xx ~]$ docker logs aaasdas9c356 &gt; docker.log
  Debugger failed to attach: handshake failed - received &gt;GET / HTTP/1.0 &lt; - expected &gt;JDWP-Handshake&lt;
  Debugger failed to attach: recv failed during handshake: Resource temporarily unavailable
  Debugger failed to attach: received &gt;&lt; - expected &gt;JDWP-Handshake&lt;
  [root@ip-xx-xx-xx-xx ~]$
  </code></pre>
  
  <p>Just wondering why the output will have different behaviour.</p>
  
  <p>Thanks</p>