How do I update the log4j version from 1.2 to 2.16 or higher? This is what I have in my pom.xml file right now(using maven) for job4j-api and job4j-core but nothing for just job4j
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
</dependency>
I can see their current versions and that it is not updated in the shell view here. I tried adding the following snippet
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>2.17.1</version>
</dependency>
but didn't seem to work. Do i need to update the jar file somehwere? Any hints would be highly appreciated. Thanks.
Merely adding a dependency on log4j2 won't get rid of the dependency on log4j1. You also need to remove that dependency from your pom.
If you didn't add it explicitly, it's there as a transient dependency and being injected by something else. You'll need to figure out what that something else is, and add an exclusion of log4j to it (and then hope it still works, there are ways to proxy log4j2 to be accessible using log4j1 APIs but it's not automatic. Search for it in the documentation).