<p>I run an <code>.NET Core 2.1</code> in a container. It writes logs to a file within the container. I am able to run a <code>docker exec bash</code> command to inspect the log file, locally.</p>

<p>This application is then deployed with <code>Kubernetes</code> to a pod with more than one container.</p>

<p>How can I inspect the log file within each one of these containers?</p>

<p>You can exec into container within pod:</p>

<pre><code>kubectl -n &lt;namespace&gt; exec -it &lt;pod name&gt; -c &lt;container name&gt; bash
</code></pre>

<p>But the better approach is to make your application stream logs to stdout or stderr, so you can access it directly with:</p>

<pre><code>kubectl -n &lt;namespace&gt; logs &lt;pod name&gt; -c &lt;container name&gt; 
</code></pre>
