0

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?

MidnightJava
  • 1,927
  • 2
  • 18
  • 38
  • Check with `-Dlog4j2.debug=true` if it really does not find your configuration (check the applications standard output). BTW: version `2.13.0` has several vulnerabilities, upgrade to the latest version (`2.19.0`) – Piotr P. Karwasz Sep 17 '22 at 21:58

0 Answers0