<p>I have tried</p>

<pre><code>kubectl create -f x.yaml --logtostderr=true
</code></pre>

<p>but it didn't work.</p>

<p><a href="https://i.stack.imgur.com/W5Vv7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W5Vv7.png" alt="enter image description here"></a></p>

<p>The Kubernetes API doesn't currently expose a way to change the logging behavior. It'll rotate the log files as appropriate to avoid filling up the disk, but if you need more control, you'll have to <a href="https://docs.docker.com/engine/admin/logging/overview/" rel="nofollow">modify the docker daemon on each node to change its logging driver</a>.</p>

<p>Or if you want to do it for a specific application, change the command in your x.yaml file that you're using to start the app to redirect stdout and stderr to /dev/null inside the container.</p>
