Building and Installing Log4j 2.x

Building

Log4j 2.x is hosted in the Apache Software Foundation's subversion repository. Details on obtaining the most current source code can be found at Log4j Source Repository]. The source from the latest release may be obtained by downloading it using the instructions at Log4j Downloads.

Log4j 2.x uses Maven 2 or 3 as its build tool. To build Log4j simply run "mvn install" from the root directory.

Using In Applications

To use Log4j 2 in your application make sure that both the API and Core jars are in the application's classpath. With Maven add the dependencies listed below to your pom.xml.

    <dependencies>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>2.0-beta2</version>
      </dependency>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.0-beta2</version>
      </dependency>
    </dependecies>