I think you need both the API and the Core jars in your classpath. Follow these instructions for build and install and these for configuration. On the configuration page, the import line you're asking about is import org.apache.logging.log4j.Logger;
, so the Logger
class will be pulled from the API jar.
Log4j 2 needs two jars (as opposed to Log4j 1.x which needed one) because of the:
API Separation
The API for Log4j is separate from the implementation making it clear for application developers which classes and methods they can use while ensuring forward compatibility. This allows the Log4j team to improve the implementation safely and in a compatible manner.