Repository: logging-log4j2 Updated Branches: refs/heads/master d29dea42b -> b632059c6
Convert maven artifacts page to markdown And they said you can't use regular expressions on XML. <https://stackoverflow.com/a/1732454>. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/b632059c Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/b632059c Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/b632059c Branch: refs/heads/master Commit: b632059c6be8335c97d33483fbf35cf67e39893b Parents: d29dea4 Author: Matt Sicker <boa...@gmail.com> Authored: Sun Jan 29 12:06:01 2017 -0600 Committer: Matt Sicker <boa...@gmail.com> Committed: Sun Jan 29 12:06:01 2017 -0600 ---------------------------------------------------------------------- src/site/markdown/maven-artifacts.md.vm | 513 +++++++++++++++++++++++++++ src/site/xdoc/maven-artifacts.xml.vm | 436 ----------------------- 2 files changed, 513 insertions(+), 436 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b632059c/src/site/markdown/maven-artifacts.md.vm ---------------------------------------------------------------------- diff --git a/src/site/markdown/maven-artifacts.md.vm b/src/site/markdown/maven-artifacts.md.vm new file mode 100644 index 0000000..b4949fe --- /dev/null +++ b/src/site/markdown/maven-artifacts.md.vm @@ -0,0 +1,513 @@ +<!-- vim: set syn=markdown : --> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +#set($h1='#') +#set($h2='##') +#set($h3='###') + +$h1 Maven, Ivy, and Gradle Artifacts + +Log4j 2 is broken up in an API and an implementation (core), where the API +provides the interface that applications should code to. +Strictly speaking Log4j core is only needed at runtime and not at compile time. + +However, below we list Log4j core as a compile time dependency +to improve the startup time for [custom plugins](manual/plugins.html) as it provides an +annotation processor that generates a metadata file to cache plugin information as well +as the necessary code to compile against to create custom plugins. + +$h2 Using Log4j in your Apache Maven build + +To build with [Apache Maven](https://maven.apache.org/), add the dependencies listed below to your +`pom.xml` file. + +`pom.xml` + +``` +<dependencies> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-api</artifactId> + <version>${Log4jReleaseVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> + <version>${Log4jReleaseVersion}</version> + </dependency> +</dependencies> +``` + +$h2 Using Log4j in your Apache Ivy build + +To build with [Apache Ivy](https://ant.apache.org/ivy/), add the dependencies listed below to your +`ivy.xml` file. + +`ivy.xml` + +``` +<dependencies> + <dependency org="org.apache.logging.log4j" name="log4j-api" rev="${Log4jReleaseVersion}" /> + <dependency org="org.apache.logging.log4j" name="log4j-core" rev="${Log4jReleaseVersion}" /> +</dependencies> +``` + +$h2 Using Log4j in your Gradle build + +To build with [Gradle](https://gradle.org/), add the dependencies listed below to your +`build.gradle` file. + +`build.gradle` + +``` +dependencies { + compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '${Log4jReleaseVersion}' + compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '${Log4jReleaseVersion}' +} +``` + +$h2 Bill of Material + +To keep your Log4j module versions in sync with each other, a +<abbr id="Bill of Material">BOM</abbr> +pom.xml file is provided for your convenience. To use this with +[Maven](https://maven.apache.org/), add the dependency listed below to your +`pom.xml` +file. When you specify the version identifier in this section, you don't have to specify the version in your +`<dependencies/>` section. + +`pom.xml` + +``` +<dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-bom</artifactId> + <version>${Log4jReleaseVersion}</version> + <scope>import</scope> + <type>pom</type> + </dependency> + </dependencies> +</dependencyManagement> +``` + +To use this with Gradle, an additional [Gradle plugin](https://github.com/spring-gradle-plugins/dependency-management-plugin) +is required for dependency management functionality. + +`build.gradle` + +``` +plugins { + id 'io.spring.dependency-management' version '1.0.0.RC2' +} + +dependencyManagement { + imports { + mavenBom 'org.apache.logging.log4j:log4j-bom:${Log4jReleaseVersion}' + } +} + +dependencies { + compile 'org.apache.logging.log4j:log4j-api' + compile 'org.apache.logging.log4j:log4j-core' + // etc. +} +``` + +$h2 Optional Components + +Log4j 2.x contains several optional components that can be included in an application. + +$h3 Log4j 1.x API Bridge + +If existing components use Log4j 1.x and you want to have this logging routed to Log4j 2, +then remove any log4j 1.x dependencies and add the following. + +`pom.xml` + +``` +<dependencies> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-1.2-api</artifactId> + <version>${Log4jReleaseVersion}</version> + </dependency> +</dependencies> +``` + +`ivy.xml` + +``` +<dependencies> + <dependency org="org.apache.logging.log4j" name="log4j-1.2-api" rev="${Log4jReleaseVersion}" /> +</dependencies> +``` + +`build.gradle` + +``` +dependencies { + compile group: 'org.apache.logging.log4j', name: 'log4j-1.2-api', version: '${Log4jReleaseVersion}' +} +``` + +$h3 Apache Commons Logging Bridge + +If existing components use Apache Commons Logging 1.x and you want to have this logging routed to Log4j 2, +then add the following but do not remove any Commons Logging 1.x dependencies. + +`pom.xml` + +``` +<dependencies> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-jcl</artifactId> + <version>${Log4jReleaseVersion}</version> + </dependency> +</dependencies> +``` + +`ivy.xml` + +``` +<dependencies> + <dependency org="org.apache.logging.log4j" name="log4j-jcl" rev="${Log4jReleaseVersion}" /> +</dependencies> +``` + +`build.gradle` + +``` +dependencies { + compile group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '${Log4jReleaseVersion}' +} +``` + +$h3 SLF4J Bridge + +If existing components use SLF4J and you want to have this logging routed to Log4j 2, then add the +following but do not remove any SLF4J dependencies. + +`pom.xml` + +``` +<dependencies> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-slf4j-impl</artifactId> + <version>${Log4jReleaseVersion}</version> + </dependency> +</dependencies> +``` + +`ivy.xml` + +``` +<dependencies> + <dependency org="org.apache.logging.log4j" name="log4j-slf4j-impl" rev="${Log4jReleaseVersion}" /> +</dependencies> +``` + +`build.gradle` + +``` +dependencies { + compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '${Log4jReleaseVersion}' +} +``` + +$h3 JUL Adapter + +If existing components use Java Util Logging and you want to have this logging routed to Log4j 2, +then add the following. + +`pom.xml` + +``` +<dependencies> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-jul</artifactId> + <version>${Log4jReleaseVersion}</version> + </dependency> +</dependencies> +``` + +`ivy.xml` + +``` +<dependencies> + <dependency org="org.apache.logging.log4j" name="log4j-jul" rev="${Log4jReleaseVersion}" /> +</dependencies> +``` + +`build.gradle` + +``` +dependencies { + compile group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '${Log4jReleaseVersion}' +} +``` + +$h3 Web Servlet Support + +In order to properly support and handle the ClassLoader environment and container lifecycle of a web +application, an additional module is required. This module is only required at runtime. In addition, if +you're using servlets in an OSGi environment, make sure your preferred version of the servlet API is +already available (e.g., if you want to use 3.0, but you've also got 2.5 loaded, make sure both are +loaded). + +`pom.xml` + +``` +<dependencies> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-web</artifactId> + <version>${Log4jReleaseVersion}</version> + <scope>runtime</scope> + </dependency> +</dependencies> +``` + +`ivy.xml` + +``` +<dependencies> + <dependency org="org.apache.logging.log4j" name="log4j-web" rev="${Log4jReleaseVersion}" /> +</dependencies> +``` + +`build.gradle` + +``` +dependencies { + compile group: 'org.apache.logging.log4j', name: 'log4j-web', version: '${Log4jReleaseVersion}' +} +``` + +$h3 Tag Library + +The Log4j Log Tag Library creates the capability of inserting log statements in JSPs without +the use of Java scripting. It uses the standard Log4j 2 API to log messages according to +your Log4j configuration. + +`pom.xml` + +``` +<dependencies> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-taglib</artifactId> + <version>${Log4jReleaseVersion}</version> + </dependency> +</dependencies> +``` + +`ivy.xml` + +``` +<dependencies> + <dependency org="org.apache.logging.log4j" name="log4j-taglib" rev="${Log4jReleaseVersion}" /> +</dependencies> +``` + +`build.gradle` + +``` +dependencies { + compile group: 'org.apache.logging.log4j', name: 'log4j-taglib', version: '${Log4jReleaseVersion}' +} +``` + +$h3 Apache Flume Appender + +The Flume Appender allows applications to send events to Flume Agents. + +`pom.xml` + +``` +<dependencies> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-flume-ng</artifactId> + <version>${Log4jReleaseVersion}</version> + </dependency> +</dependencies> +``` + +`ivy.xml` + +``` +<dependencies> + <dependency org="org.apache.logging.log4j" name="log4j-flume-ng" rev="${Log4jReleaseVersion}" /> +</dependencies> +``` + +`build.gradle` + +``` +dependencies { + compile group: 'org.apache.logging.log4j', name: 'log4j-flume-ng', version: '${Log4jReleaseVersion}' +} +``` + +$h3 Log4j to SLF4J Adapter + +The Log4j 2 to SLF4J Adapter allows applications coded to the Log4j 2 API to be routed to SLF4J. Use of this +adapter may cause some loss of performance as the Log4j 2 Messages must be formatted before they can be passed +to SLF4J. The SLF4J Bridge must NOT be on the class path when this is in use. + +`pom.xml` + +``` +<dependencies> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-to-slf4j</artifactId> + <version>${Log4jReleaseVersion}</version> + </dependency> +</dependencies> +``` + +`ivy.xml` + +``` +<dependencies> + <dependency org="org.apache.logging.log4j" name="log4j-to-slf4j" rev="${Log4jReleaseVersion}" /> +</dependencies> +``` + +`build.gradle` + +``` +dependencies { + compile group: 'org.apache.logging.log4j', name: 'log4j-to-slf4j', version: '${Log4jReleaseVersion}' +} +``` + +$h3 NoSQL Appenders + +If your configuration uses one of the NoSQL Appenders, then add the following. + +`pom.xml` + +``` +<dependencies> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-nosql</artifactId> + <version>${Log4jReleaseVersion}</version> + </dependency> +</dependencies> +``` + +`ivy.xml` + +``` +<dependencies> + <dependency org="org.apache.logging.log4j" name="log4j-nosql" rev="${Log4jReleaseVersion}" /> +</dependencies> +``` + +`build.gradle` + +``` +dependencies { + compile group: 'org.apache.logging.log4j', name: 'log4j-nosql', version: '${Log4jReleaseVersion}' +} +``` + +$h3 IO Streams + +Log4j IO Streams allow applications to have data that is written to an OutputStream +or a Writer be redirected to a Logger, or have data that is read from an InputStream or +a Reader be wiretapped by a Logger. To use IO Streams, add the following. + +`pom.xml` + +``` +<dependencies> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-iostreams</artifactId> + <version>${Log4jReleaseVersion}</version> + </dependency> +</dependencies> +``` + +`ivy.xml` + +``` +<dependencies> + <dependency org="org.apache.logging.log4j" name="log4j-iostreams" rev="${Log4jReleaseVersion}" /> +</dependencies> +``` + +`build.gradle` + +``` +dependencies { + compile group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '${Log4jReleaseVersion}' +} +``` + +$h3 Scala API + +A convenient Scala wrapper for the Logger API + +`build.sbt` + +``` +"org.apache.logging.log4j" %% "log4j-api-scala" % "${Log4jReleaseVersion}" +``` + +`pom.xml` + +``` +<dependencies> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-api-scala_2.11</artifactId> + <version>${Log4jReleaseVersion}</version> + </dependency> +</dependencies> +``` + +`ivy.xml` + +``` +<dependencies> + <dependency org="org.apache.logging.log4j" name="log4j-api-scala_2.11" rev="${Log4jReleaseVersion}" /> +</dependencies> +``` + +`build.gradle` + +``` +dependencies { + compile group: 'org.apache.logging.log4j', name: 'log4j-api-scala_2.11', version: '${Log4jReleaseVersion}' +} +``` + +$h2 Snapshot builds + +You can access the latest development snapshot by using the Maven repository +`https://repository.apache.org/content/repositories/snapshots/` and the current SNAPSHOT version. +<!-- TODO: add example configs for maven/gradle to use this repo --> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b632059c/src/site/xdoc/maven-artifacts.xml.vm ---------------------------------------------------------------------- diff --git a/src/site/xdoc/maven-artifacts.xml.vm b/src/site/xdoc/maven-artifacts.xml.vm deleted file mode 100644 index e489863..0000000 --- a/src/site/xdoc/maven-artifacts.xml.vm +++ /dev/null @@ -1,436 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd"> - - <properties> - <title>Maven, Ivy, and Gradle Artifacts</title> - </properties> - - <body> - <section name="Maven, Ivy, and Gradle Artifacts"> - <p> - Log4j 2 is broken up in an API and an implementation (core), where the API - provides the interface that applications should code to. - Strictly speaking Log4j core is only needed at runtime and not at compile time. - </p><p> - However, below we list Log4j core as a compile time dependency - to improve the startup time for <a href="manual/plugins.html">custom plugins</a>. - </p> - - <subsection name="Using Log4j in your Apache Maven build"> - <p> - To build with <a href="https://maven.apache.org/">Apache Maven</a>, add the dependencies listed below to your - <code>pom.xml</code> file. - </p> - <code>pom.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-api</artifactId> - <version>${Log4jReleaseVersion}</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${Log4jReleaseVersion}</version> - </dependency> -</dependencies> -]]></pre> - </subsection> - <subsection name="Using Log4j in your Apache Ivy build"> - <p> - To build with <a href="https://ant.apache.org/ivy/">Apache Ivy</a>, add the dependencies listed below to your - <code>ivy.xml</code> file. - </p> - <code>ivy.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency org="org.apache.logging.log4j" name="log4j-api" rev="${Log4jReleaseVersion}" /> - <dependency org="org.apache.logging.log4j" name="log4j-core" rev="${Log4jReleaseVersion}" /> -</dependencies> -]]></pre> - </subsection> - <subsection name="Using Log4j in your Gradle build"> - <p> - To build with <a href="https://gradle.org/">Gradle</a>, add the dependencies listed below to your - <code>build.gradle</code> file. - </p> - <code>build.gradle</code> - <pre class="prettyprint linenums"><![CDATA[ -dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '${Log4jReleaseVersion}' - compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '${Log4jReleaseVersion}' -} -]]></pre> - </subsection> - <subsection name="Bill of Material"> - <p> - To keep your Log4j module versions in sync with each other, a - <abbr id="Bill of Material">BOM</abbr> - pom.xml file is provided for your convenience. To use this with - <a href="https://maven.apache.org/">Maven</a>, add the dependency listed below to your - <code>pom.xml</code> - file. When you specify the version identifier in this section, you don't have to specify the version in your - <code><![CDATA[<dependencies/>]]></code> - section. - </p> - <code>pom.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencyManagement> - <dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-bom</artifactId> - <version>${Log4jReleaseVersion}</version> - <scope>import</scope> - <type>pom</type> - </dependency> - </dependencies> -</dependencyManagement> -]]></pre> - <p> - To use this with Gradle, an additional <a href="https://github.com/spring-gradle-plugins/dependency-management-plugin">Gradle plugin</a> - is required for dependency management functionality. - </p> - <code>build.gradle</code> - <pre class="prettyprint linenums"><![CDATA[ -plugins { - id 'io.spring.dependency-management' version '1.0.0.RC2' -} - -dependencyManagement { - imports { - mavenBom 'org.apache.logging.log4j:log4j-bom:${Log4jReleaseVersion}' - } -} - -dependencies { - compile 'org.apache.logging.log4j:log4j-api' - compile 'org.apache.logging.log4j:log4j-core' - // etc. -} -]]></pre> - </subsection> - <subsection name="Optional Components"> - <p> - Log4j 2.x contains several optional components that can be included in an application. - </p> - <h4>Log4j 1.x API Bridge</h4> - <p>If existing components use Log4j 1.x and you want to have this logging routed to Log4j 2, - then remove any log4j 1.x dependencies and add the following. - </p> - <code>pom.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-1.2-api</artifactId> - <version>${Log4jReleaseVersion}</version> - </dependency> -</dependencies> -]]></pre> - <code>ivy.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency org="org.apache.logging.log4j" name="log4j-1.2-api" rev="${Log4jReleaseVersion}" /> -</dependencies> -]]></pre> - <code>build.gradle</code> - <pre class="prettyprint linenums"><![CDATA[ -dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-1.2-api', version: '${Log4jReleaseVersion}' -} -]]></pre> - <h4>Apache Commons Logging Bridge</h4> - <p>If existing components use Apache Commons Logging 1.x and you want to have this logging routed to Log4j 2, - then add the following but do not remove any Commons Logging 1.x dependencies. - </p> - <code>pom.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-jcl</artifactId> - <version>${Log4jReleaseVersion}</version> - </dependency> -</dependencies> -]]></pre> - <code>ivy.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency org="org.apache.logging.log4j" name="log4j-jcl" rev="${Log4jReleaseVersion}" /> -</dependencies> -]]></pre> - <code>build.gradle</code> - <pre class="prettyprint linenums"><![CDATA[ -dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '${Log4jReleaseVersion}' -} -]]></pre> - <h4>SLF4J Bridge</h4> - <p>If existing components use SLF4J and you want to have this logging routed to Log4j 2, then add the - following but do not remove any SLF4J dependencies. - </p> - <code>pom.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-slf4j-impl</artifactId> - <version>${Log4jReleaseVersion}</version> - </dependency> -</dependencies> -]]></pre> - <code>ivy.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency org="org.apache.logging.log4j" name="log4j-slf4j-impl" rev="${Log4jReleaseVersion}" /> -</dependencies> -]]></pre> - <code>build.gradle</code> - <pre class="prettyprint linenums"><![CDATA[ -dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '${Log4jReleaseVersion}' -} -]]></pre> - <h4>JUL Adapter</h4> - <p>If existing components use Java Util Logging and you want to have this logging routed to Log4j 2, - then add the following. - </p> - <code>pom.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-jul</artifactId> - <version>${Log4jReleaseVersion}</version> - </dependency> -</dependencies> -]]></pre> - <code>ivy.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency org="org.apache.logging.log4j" name="log4j-jul" rev="${Log4jReleaseVersion}" /> -</dependencies> -]]></pre> - <code>build.gradle</code> - <pre class="prettyprint linenums"><![CDATA[ -dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '${Log4jReleaseVersion}' -} -]]></pre> - <h4>Web Servlet Support</h4> - <p> - In order to properly support and handle the ClassLoader environment and container lifecycle of a web - application, an additional module is required. This module is only required at runtime. In addition, if - you're using servlets in an OSGi environment, make sure your preferred version of the servlet API is - already available (e.g., if you want to use 3.0, but you've also got 2.5 loaded, make sure both are - loaded). - </p> - <code>pom.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-web</artifactId> - <version>${Log4jReleaseVersion}</version> - <scope>runtime</scope> - </dependency> -</dependencies> - ]]></pre> - <code>ivy.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency org="org.apache.logging.log4j" name="log4j-web" rev="${Log4jReleaseVersion}" /> -</dependencies> - ]]></pre> - <code>build.gradle</code> - <pre class="prettyprint linenums"><![CDATA[ -dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-web', version: '${Log4jReleaseVersion}' -} - ]]></pre> - <h4>Tag Library</h4> - <p>The Log4j Log Tag Library creates the capability of inserting log statements in JSPs without - the use of Java scripting. It uses the standard Log4j 2 API to log messages according to - your Log4j configuration. - </p> - <code>pom.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-taglib</artifactId> - <version>${Log4jReleaseVersion}</version> - </dependency> -</dependencies> -]]></pre> - <code>ivy.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency org="org.apache.logging.log4j" name="log4j-taglib" rev="${Log4jReleaseVersion}" /> -</dependencies> -]]></pre> - <code>build.gradle</code> - <pre class="prettyprint linenums"><![CDATA[ -dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-taglib', version: '${Log4jReleaseVersion}' -} -]]></pre> - <h4>Apache Flume Appender</h4> - <p>The Flume Appender allows applications to send events to Flume Agents.</p> - <code>pom.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-flume-ng</artifactId> - <version>${Log4jReleaseVersion}</version> - </dependency> -</dependencies> -]]></pre> - <code>ivy.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency org="org.apache.logging.log4j" name="log4j-flume-ng" rev="${Log4jReleaseVersion}" /> -</dependencies> -]]></pre> - <code>build.gradle</code> - <pre class="prettyprint linenums"><![CDATA[ -dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-flume-ng', version: '${Log4jReleaseVersion}' -} -]]></pre> - <h4>Log4j to SLF4J Adapter</h4> - <p>The Log4j 2 to SLF4J Adapter allows applications coded to the Log4j 2 API to be routed to SLF4J. Use of this - adapter may cause some loss of performance as the Log4j 2 Messages must be formatted before they can be passed - to SLF4J. The SLF4J Bridge must NOT be on the class path when this is in use.</p> - <code>pom.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-to-slf4j</artifactId> - <version>${Log4jReleaseVersion}</version> - </dependency> -</dependencies> -]]></pre> - <code>ivy.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency org="org.apache.logging.log4j" name="log4j-to-slf4j" rev="${Log4jReleaseVersion}" /> -</dependencies> -]]></pre> - <code>build.gradle</code> - <pre class="prettyprint linenums"><![CDATA[ -dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-to-slf4j', version: '${Log4jReleaseVersion}' -} -]]></pre> - <h4>NoSQL Appenders</h4> - <p>If your configuration uses one of the NoSQL Appenders, then add the following. - </p> - <code>pom.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-nosql</artifactId> - <version>${Log4jReleaseVersion}</version> - </dependency> -</dependencies> -]]></pre> - <code>ivy.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency org="org.apache.logging.log4j" name="log4j-nosql" rev="${Log4jReleaseVersion}" /> -</dependencies> -]]></pre> - <code>build.gradle</code> - <pre class="prettyprint linenums"><![CDATA[ -dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-nosql', version: '${Log4jReleaseVersion}' -} -]]></pre> - <h4>IO Streams</h4> - <p>Log4j IO Streams allow applications to have data that is written to an OutputStream - or a Writer be redirected to a Logger, or have data that is read from an InputStream or - a Reader be wiretapped by a Logger. - To use IO Streams, add the following. - </p> - <code>pom.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-iostreams</artifactId> - <version>${Log4jReleaseVersion}</version> - </dependency> -</dependencies> -]]></pre> - <code>ivy.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency org="org.apache.logging.log4j" name="log4j-iostreams" rev="${Log4jReleaseVersion}" /> -</dependencies> -]]></pre> - <code>build.gradle</code> - <pre class="prettyprint linenums"><![CDATA[ -dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '${Log4jReleaseVersion}' -} -]]></pre> - <h4>Scala API</h4> - <p>A convenient Scala wrapper for the Logger API</p> - <code>build.sbt</code> - <pre class="prettyprint linenums"><![CDATA[ -"org.apache.logging.log4j" %% "log4j-api-scala" % "${Log4jReleaseVersion}" -]]></pre> - <code>pom.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-api-scala_2.11</artifactId> - <version>${Log4jReleaseVersion}</version> - </dependency> -</dependencies> -]]></pre> - <code>ivy.xml</code> - <pre class="prettyprint linenums"><![CDATA[ -<dependencies> - <dependency org="org.apache.logging.log4j" name="log4j-api-scala_2.11" rev="${Log4jReleaseVersion}" /> -</dependencies> -]]></pre> - <code>build.gradle</code> - <pre class="prettyprint linenums"><![CDATA[ -dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-api-scala_2.11', version: '${Log4jReleaseVersion}' -} -]]></pre> - </subsection> - </section> - <subsection name="Snapshot builds"> - <p>You can access the latest development snapshot by using the Maven repository - <code>https://repository.apache.org/content/repositories/snapshots/</code> and the current SNAPSHOT version.</p> - <!-- TODO: add example configs for maven/gradle to use this repo --> - </subsection> - </body> -</document>