<p><a href="https://i.stack.imgur.com/YR7AQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YR7AQ.png" alt="enter image description here"></a></p>

<p>but the problem is my application is running before my server started (WebLogic server).</p>

Kundan Kumar
<p>Your question seems to be in reference to Log4j 1. Log4j 1 has been end-of-life since August of 2015. </p>

<p>Upgrading to Log4j 2.13.0 would allow you to use the Kubernetes Lookup which would allow you to configure your log file name as:</p>

<pre><code>&lt;File name="MyFile" filename="${path}/app_${k8s:containerName}.${date:MM-dd-yyyy}.log&gt;
  &lt;PatternLayout&gt;
    &lt;Pattern&gt;%d %p %c{1.} [%t] %m%n&lt;/Pattern&gt;
  &lt;/PatternLayout&gt;
&lt;/File&gt;
</code></pre>
