log4j2 can't locate config file

Viewed 14

I'm using log4j2.13.0 with Java 11, and it will not find the XML config file using VM arg -Dlog4j.configurationFile=/path/tofile, despite everything I'm reading saying that should work. It can find it if I cput the file on the classpath, but I'd like to point it to it explicitly.

This is what I'm installing via Maven:

<dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.13.0</version>
          </dependency>
          <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.13.0</version>
</dependency>

I do not have any slf4j or other logging frameworks installed. Am I missing some additional jar files?

0 Answers
Related