<p>I have a mysqldb pod and need to add a log when we run a script restorebackup.sh. The script is inside the pod and i need this log in the general logs of the pod (to access it with kubectl get logs services/mysqldb).</p>
<p>There is any way to do this?</p>

Vitor Estevam
<p>Generally the <code>kubectl logs</code> shows the first process's stdout (pid=1).
So you could try put logs to /proc/1/fd/1 in you pod.</p>
<p>An example command in pod:</p>
<pre><code>echo hello &gt;&gt; /proc/1/fd/1
</code></pre>
<p>Then you will able to see this <code>hello</code> by <code>kubectl logs</code>.</p>
<p>For you script <code>restorebackup.sh</code>, maybe you could try <code>sh restorebackup.sh &gt;&gt; /proc/1/fd/1</code> to redirect all outputs.</p>
