I have application which when I run from maven log4j2 it is working:
mvn exec:java -Dexec.args=...
but when I run jar as standalone applica
ok I found this issue about this problem.
In short, the problem arises when application classes are packaged in uber jar using maven shade plugin.
While for log4j2 version 2.8.1 the fix is still pending, the suggested workaround is to update maven pom.xml with extra configuration settings for shade plugin as follow:
. . . . .
. . . . .
. . . . .
org.apache.maven.plugins
maven-shade-plugin
2.4.1
*:*
META-INF/*.SF
META-INF/*.DSA
META-INF/*.RSA
package
shade
com.github.edwgiz
maven-shade-plugin.log4j2-cachefile-transformer
2.1
. . . . .
. . . . .
. . . . .
oss.sonatype.org
OSS Sonatype Staging
https://oss.sonatype.org/content/groups/staging
. . . . .