any way to limit "docker logs" output by default? Context*
I forgot to pass the &quot;--tail&quot; options to the &quot;docker logs&quot; command when inspecting a running container. The affected container dumps tens of millions of logs.
The command line was something like:
  $ docker logs contianer01 | vim -

When executing such line my server becomes completely unresponsive for minutes due to exhaution of free RAM memory with peak loads beyond 60x100%. I loose control of the terminal and ssh connection fails.
Question:
Is it any tunning in docker to &quot;fail fast&quot; and forbid such big log outputs in first place (maybe tunning ulimits for the docker daemon in some config file)
NOTE: Probably &quot;ulimit&quot;, &quot;resource-control&quot; and &quot;linux&quot; tags must be added to this question but I have not enough &quot;reputation&quot;.
One way to limit docker logs is to specify limits in docker daemon's config file.
You can put this in /etc/docker/daemon.json
{
  &quot;log-driver&quot;: &quot;json-file&quot;,
  &quot;log-opts&quot;: {
    &quot;max-size&quot;: &quot;10m&quot;,
    &quot;max-file&quot;: &quot;3&quot; 
  }
}

and then restart your docker daemon.