log4j2.xml is not getting called in Docker container

Solution 1:

log4j2.xml should be under src/main/resources folder. Before i didn't have this folder instead i was using src/main/java.

I have added the below listing in pom file which resolved the issue.

<resources>
            <resource>
                <directory>src/main/java</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
            </resource>
</resources>