skywatcher
skywatcher

Reputation: 31

Log4j2 - cannot access ListAppender

I'm creating Spring-Boot application with Log4j2. Libraries that I use are: https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api/2.11.1 https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core/2.11.1

Class ListAppender cannot be found in these jars. When I try to import: org.apache.logging.log4j.test there is an info: "Cannot resolve symbol...", like there is no package like this. But I can see in github: https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java that it exists.

What is the source of problem? Am I doing everything in right way?

Upvotes: 0

Views: 4190

Answers (1)

Andreas
Andreas

Reputation: 159114

As the path of the URL shows, ListAppender is in /src/test, which means it is an internal class used only for testing Log4J itself, not for your use.

The fact that you tried to import a package named test would also be a hint that you're trying to use "test" code.

Upvotes: 2

Related Questions