[maven-release-plugin] copy for tag log4j-2.20.0-rc1
[maven-release-plugin] prepare release log4j-2.20.0-rc1
50 files changed
tree: 351e135ddfb9f7b2f02b903138cff0777a9a2871
  1. .github/
  2. .mvn/
  3. bin/
  4. docs/
  5. log4j-1.2-api/
  6. log4j-api/
  7. log4j-api-java9/
  8. log4j-api-test/
  9. log4j-appserver/
  10. log4j-bom/
  11. log4j-cassandra/
  12. log4j-core/
  13. log4j-core-its/
  14. log4j-core-java9/
  15. log4j-core-test/
  16. log4j-couchdb/
  17. log4j-distribution/
  18. log4j-docker/
  19. log4j-flume-ng/
  20. log4j-iostreams/
  21. log4j-jakarta-smtp/
  22. log4j-jakarta-web/
  23. log4j-jcl/
  24. log4j-jdbc-dbcp2/
  25. log4j-jmx-gui/
  26. log4j-jpa/
  27. log4j-jpl/
  28. log4j-jul/
  29. log4j-kubernetes/
  30. log4j-layout-template-json/
  31. log4j-layout-template-json-test/
  32. log4j-mongodb3/
  33. log4j-mongodb4/
  34. log4j-osgi/
  35. log4j-perf/
  36. log4j-samples/
  37. log4j-slf4j-impl/
  38. log4j-slf4j2-impl/
  39. log4j-spring-boot/
  40. log4j-spring-cloud-config/
  41. log4j-taglib/
  42. log4j-to-jul/
  43. log4j-to-slf4j/
  44. log4j-web/
  45. src/
  46. .asf.yaml
  47. .gitattributes
  48. .gitignore
  49. .java-version
  50. BUILDING.md
  51. CHANGELOG.adoc
  52. checkstyle-header.txt
  53. checkstyle-import-control.xml
  54. checkstyle-suppressions.xml
  55. checkstyle.xml
  56. CODE_OF_CONDUCT.md
  57. CONTRIBUTING.md
  58. findbugs-exclude-filter.xml
  59. LICENSE.txt
  60. mvnw
  61. mvnw.cmd
  62. NOTICE.txt
  63. pom.xml
  64. README.md
  65. RELEASE-NOTES.md
  66. SECURITY.md
README.md

Apache Log4j 2

Apache Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many of the improvements available in Logback while fixing some inherent problems in Logback's architecture.

Maven Central build (2.x) build (3.x) CodeQL

Pull Requests on Github

By sending a pull request you grant the Apache Software Foundation sufficient rights to use and release the submitted work under the Apache license. You grant the same rights (copyright license, patent license, etc.) to the Apache Software Foundation as if you have signed a Contributor License Agreement. For contributions that are judged to be non-trivial, you will be asked to actually signing a Contributor License Agreement.

Usage

Users should refer to Maven, Ivy, Gradle, and SBT Artifacts on the Log4j website for instructions on how to include Log4j into their project using their chosen build tool.

Basic usage of the Logger API:

package com.example;

import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

public class Example {
    private static final Logger LOGGER = LogManager.getLogger();

    public static void main(String... args) {
        String thing = args.length > 0 ? args[0] : "world";
        LOGGER.info("Hello, {}!", thing);
        LOGGER.debug("Got calculated value only if debug enabled: {}", () -> doSomeCalculation());
    }

    private static Object doSomeCalculation() {
        // do some complicated calculation
    }
}

And an example log4j2.xml configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
  <Appenders>
    <Console name="Console" target="SYSTEM_OUT">
      <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
    </Console>
  </Appenders>
  <Loggers>
    <Logger name="com.example" level="INFO"/>
    <Root level="error">
      <AppenderRef ref="Console"/>
    </Root>
  </Loggers>
</Configuration>

Documentation

The Log4j 2 User's Guide is available here or as a downloadable PDF.

Requirements

  • Java 8 users should use 2.17.1 or greater.
  • Java 7 users should use 2.12.4.
  • Java 6 users should use 2.3.2.
  • Some features require optional dependencies; the documentation for these features specifies the dependencies.

License

Apache Log4j 2 is distributed under the Apache License, version 2.0.

Download

How to download Log4j, and how to use it from Maven, Ivy and Gradle. You can access the latest development snapshot by using the Maven repository https://repository.apache.org/snapshots, see Snapshot builds.

Issue Tracking

Issues, bugs, and feature requests should be submitted to the issue tracker.

Pull requests on GitHub are welcome, but please open a ticket in the issue tracker first, and mention the issue in the pull request.

Building From Source

See the detailed build instructions on how to build to the project and website from sources.

Contributing

We love contributions! Take a look at our contributing page.