Log4j API

Log4j is essentially composed of a logging API called Log4j API, and its reference implementation called Log4j Core.

What is a logging API and a logging implementation?
Logging API

A logging API is an interface your code or your dependencies directly logs against. It is required at compile-time. It is implementation agnostic to ensure that your application can write logs, but is not tied to a specific logging implementation. Log4j API, SLF4J, JUL (Java Logging), JCL (Apache Commons Logging), JPL (Java Platform Logging) and JBoss Logging are major logging APIs.

Logging implementation

A logging implementation is only required at runtime and can be changed without the need to recompile your software. Log4j Core, JUL (Java Logging), Logback are the most well-known logging implementations.

Are you looking for a crash course on how to use Log4j in your application or library? See Getting started. You can also check out Installation for the complete installation instructions.

Starting with version 2.24.0, Log4j API is embraced as the target logging API for both Log4j 2 and Log4j 3. Hence, Log4j 3 does not contain a Log4j API module, but instead implements "the" Log4j API developed in Log4j 2 branch. This ensures Log4j 2 users can safely migrate to Log4j 3 without any Log4j API compatibility concerns.