<p>We have recently moved to micro services based architecture for our enterprise application. we are using Kubernetes cluster to host all our micro services.</p>

<p>Currently we didn't configure ELK for manage our logs, just storing application logs into azure blob storage.</p>

<p>We are facing issue, when multiple POD instances are running for one services, since all instances use same log file to update the content. due to this, instances are getting stuck and getting memory leak issue.</p>

<p>I have configured mount path in docker container , and my logback property , has below entry to write the logs.</p>

<p><code>&lt;property name="DEV_HOME" value="/mnt/azure/&lt;service-name&gt;/logs" /&gt;</code></p>

<p>Is there a way to get the pod instance name in log configuration , so that i can add one more level down, to have separate logs for different instances.</p>

<p>Or is there better way to handle this scenario.</p>

<p><code>&lt;property name="DEV_HOME" value="/mnt/azure/&lt;service-name&gt;/&lt;instances&gt;/logs" /&gt;</code></p>

<p>It should be possible to set the Pod information (including the name) as environment variables as mentioned <a href="https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/" rel="nofollow noreferrer">here</a>. In the application read the environment variable and log appropriately.</p>
