Log4j is an open source project for Apache. By using Log4j, the destination of log information can be controlled by the console, file, GUI component, or even socket server, NT event logger, UNIX Syslog Daemon. You can also control the output format of each log; by defining the level of each log information, you can more carefully control the log generation process. Most interesting is that these can be configured flexibly through a configuration file without having to modify the application code.
The Log4j API is now a fully compliant Java 9 module, while the other Log4j jar packages are Java 9-named automated modules.
This version supports SLF4J 1.7.x and SLF4J 1.8.x. Because SLF4J 1.7.x requires implementations to include classes from the org.slf4j.impl package, log4j-sl4j-impl cannot be used as a Java 9 module. In future releases, support for SLF4J 1.7.x will be removed.
Starting with Log4j 2.9.0, the Log4j API has been modified to use the java.util.ServiceLoader to determine the implementation of Log4j, and the previous binding mechanism is still supported. The Log4j API jar package is now a multi-version jar package that provides Java 9 implementation-specific classes.
The OSGi specification does not support multiple versions of jar packages, so OSGi modules will not be able to take advantage of these implementations. Note that some tools are not compatible with multi-version jar packages and may not be able to handle class files in the META-INF / versions / 9 folders, which can be fed back to the tool provider.
The minimum operating environment for Apache Log4j 2.10.0 is Java 7, and Log4j 2.3 is the last version that supports Java 6.