I am using log4j2 the jar files are following: log4j-api-2.14.0.jar log4j-core-2.14.0.jar log4j-slf4j-impl-2.14.0.jar
Executing the following line: LogManager.getLogger("com.foo.Bar1");
using the following VM argument: -Dlog4j.configuration=test1.xml
The config file test1.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console1" target="SYSTEM_OUT">
<PatternLayout
pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
</Console>
<File name="MyFile" fileName="test1.txt">
<PatternLayout>
<Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
</PatternLayout>
</File>
</Appenders>
<Loggers>
<Logger name="com.foo.Bar1" level="trace">
<AppenderRef ref="Console1" />
<AppenderRef ref="MyFile" />
</Logger>
</Loggers>
</Configuration>
the following error occurs when the java file started ERROR StatusLogger Reconfiguration failed: No configuration found for '73d16e93' at 'null' in 'null'
i understand "-Dlog4j.configuration=test1.xml" is wrong. "-Dlog4j.configurationFile=test1.xml" is correct. but i do not understand why the error appears when "-Dlog4j.configuration=test1.xml" is used.
Why the error occurs when -Dlog4j.configuration=test1.xml is used.
log4j2.configurationFile
instead oflog4j.configurationFile
. – Comparable