tag | 9a02f43da841c3d0b8f0cce2cadc02589670374e | |
---|---|---|
tagger | Matt Sicker <mattsicker@apache.org> | Sun Sep 17 23:55:00 2017 -0500 |
object | c73b7c35178d43960e393ec090e75c2cf664479b |
Tag 2.9.0 -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEnQpWqqDWDgwMfczAtMcIk7Yrq+gFAl8oxzwACgkQtMcIk7Yr q+j+pRAApu5ny+ABsRahKDi29NPokprK4e4kVhU7nZd+TTLCPrIlNjynH+U08XM1 kZL9gjPshjX2el83gSlrsqB0A3bQqrfH1QAk5dkjgu06NKJfQg4kgc39RdbjmSCn 6vEUGllHHaTJamS/IsiY5XgUJjNtg5IKy+F3nvXD3lwChfbrqTU08PXdMh5H1F4N a50cFZ/pb2M0FrUA4WyB6d6wpTJs4+ZGb6IHOJvqUQG+AoB6G1ydIy8UOZfraiCa jmMp57cKyioogD9ZPL94j9F78jGhCRamYTmhTtVm1e5hPEGqax+AexiUgPXf8hSB JdO2QjmOxjJ/pkAw8VzeyLZiMGn3fiPQiCJ3oCMAid/f6LfvMvb2SMjSO7xiXhe8 8xB/tr9j68iqsN014Yj2zLe4maL7l77+rgQcFauXzMei+wIfXTrxcDOLK67GXHu3 z8bO4kETgYVHTIIi1zcHta6trbApmaF2qpc5uzHmfCkXKzuu8UKqWiOgmlzGQixB pRPeRPF2GWWncmg8vyoeLo/j9BdhExlxjikTg/7KgQh9bTXt63sN9Iei0X5esIci NvcbVgzsXTZbKbhSGagguteaLcrgBDKABIf8XvZDTppNPHdSZI/xW+TO125ECFB4 boC0RWxGGmVGNC1FAJH1pWGmTvPlnO4ZnQ64+xPwujCG8pMz/40= =16Py -----END PGP SIGNATURE-----
commit | c73b7c35178d43960e393ec090e75c2cf664479b | [log] [tgz] |
---|---|---|
author | rgoers <ralph.goers@dslextreme.com> | Sat Aug 26 13:36:18 2017 -0700 |
committer | rgoers <ralph.goers@dslextreme.com> | Sat Aug 26 13:36:18 2017 -0700 |
tree | 5ba5a994151ecc7f714a57cb98c96c24a4bb4033 | |
parent | bf3a76d8e208f75d4fa12ffb5da22c327cbfb8b8 [diff] |
[maven-release-plugin] prepare release log4j-2.9-rc1
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 users can add the following dependencies to their pom.xml
file:
<dependencies> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.8</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.8</version> </dependency> </dependencies>
Gradle users can add the following to their build.gradle
file:
dependencies { compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.8' compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.8' }
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>
The Log4j 2 User's Guide is available here or as a downloadable PDF.
Log4j 2.4 and greater requires Java 7, versions 2.0-alpha1 to 2.3 required Java 6. Some features require optional dependencies; the documentation for these features specifies the dependencies.
Apache Log4j 2 is distributed under the Apache License, version 2.0.
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.
Issues, bugs, and feature requests should be submitted to the JIRA issue tracking system for this project.
Pull request on GitHub are welcome, but please open a ticket in the JIRA issue tracker first, and mention the JIRA issue in the Pull Request.
Log4j requires Apache Maven 3.x. To build from source and install to your local Maven repository, execute the following:
mvn install
We love contributions! Take a look at our contributing page.