<p>Using datadog official docs, I am able to print the K8s <code>stdout/stderr</code> logs in DataDog UI, my motive is to print the app logs which are generated by spring boot application at a certain location in my pod.</p>
<p>Configurations done in cluster :</p>
<ol>
<li>Created ServiceAccount in my cluster along with cluster role and cluster role binding</li>
<li>Created K8s secret to hold DataDog API key</li>
<li>Deployed the DataDog Agent as daemonset in all nodes</li>
</ol>
<p>Configurations done in App :</p>
<ol>
<li>Download datadog.jar and instrument it along with my app execution</li>
<li>Exposed ports 8125 and 8126</li>
<li>Added environment tags <code>DD_TRACE_SPAN_TAGS</code>, <code>DD_TRACE_GLOBAL_TAGS</code> in deployment file</li>
<li>Changed pattern in <code>logback.xml</code></li>
<li>Added logs config in deployment file</li>
<li>Added env tags in deployment file</li>
</ol>
<p>After doing above configurations I am able to log <code>stdout/stderr</code> logs where as I wanted to log application logs in datadog UI</p>
<p>If someone has done this please let me know what am I missing here.
If required, I can share the configurations as well. Thanks in advance</p>

Atshvrma
<p>When installing Datadog in your K8s Cluster, you install a <a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/#using-a-node-logging-agent" rel="nofollow noreferrer">Node Logging Agent</a> as a Daemonset with various volume mounts on the hosting nodes. Among other things, this gives Datadog access to the Pod logs at /var/log/pods and the container logs at /var/lib/docker/containers.</p>
<p>Kubernetes and the underlying Docker engine will only include output from stdout and stderror in those two locations (see <a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/#logging-at-the-node-level" rel="nofollow noreferrer">here</a> for more information). Everything that is written by containers to log files residing inside the containers, will be invisible to K8s, unless more configuration is applied to extract that data, e.g. by applying the <a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/#streaming-sidecar-container" rel="nofollow noreferrer">side care container pattern</a>.</p>
<p>So, to get things working in your setup, <strong>configure logback to log to stdout rather than /var/app/logs/myapp.log</strong></p>
<p>Also, if you don't use APM there is no need to instrument your code with the datadog.jar and do all that tracing setup (setting up ports etc).</p>
