<p>I have my app deployed to Kubernetes and it's producing some logs. I can see the logs by running <code>kubectl logs -f &lt;pod-id&gt; -n staging</code>, but I can't find where the logs are physically located on the pod. The <code>/var/log/</code> folder is empty, and I can't find the logs anywhere else on the pod either.</p>
<p>Why is this happening, and where should the logs be?</p>

<p>As @ Achraf Bentabib  said</p>
<p>Kubernetes creates a directory structure to help you find logs based on Pods, so you can find the container logs for each Pod running on a node at</p>
<pre><code>/var/log/pods/&lt;namespace&gt;_&lt;pod_name&gt;_&lt;pod_id&gt;/&lt;container_name&gt;/
</code></pre>
<ol>
<li><p>Identify the node on which the Pod is running:</p>
<p>kubectl get pod pod-name -owide</p>
</li>
<li><p>SSH on that node, you can check which logging driver is being used by the node with:</p>
</li>
</ol>
<p>If you are using docker then:</p>
<pre><code>docker info | grep -i logging
</code></pre>
<p>If you are using kubernetes:</p>
<pre><code>kubectl ssh node NODE_NAME
</code></pre>
<ol start="3">
<li><p>If the logging driver writes to file, you can check the current output for a specific Pod by knowing the container id of that Pod, to do so, on a control-plane node</p>
<p>kubectl get pod pod-name ojsonpath='{.status.containerStatuses[0].containerID}'</p>
</li>
</ol>
<p>Example:</p>
<pre><code>var/log/containers/&lt;pod-name&gt;_&lt;namespace&gt;_&lt;container-name-container-id&gt;.log -&gt; /var/log/pods/&lt;some-uuid&gt;/&lt;container-name&gt;_0.log
</code></pre>
