Repository: maven Updated Branches: refs/heads/slf4j-log4j2.4 [created] 2c78decb9
Package and configure log4J 2.4 by default. Replace the content of conf/logging/log4j2.xml by the one from conf/logging/log4j2-color.xml to enjoy the colorised console Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/39308e68 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/39308e68 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/39308e68 Branch: refs/heads/slf4j-log4j2.4 Commit: 39308e68f48273d4aa4f7f37a33a9b9bfd44beee Parents: 2a9a07b Author: Arnaud HeÌritier <aherit...@apache.org> Authored: Wed Apr 1 02:16:56 2015 +0200 Committer: Arnaud HeÌritier <aherit...@apache.org> Committed: Tue Sep 29 00:27:47 2015 +0200 ---------------------------------------------------------------------- apache-maven/pom.xml | 15 +++++++- apache-maven/src/conf/logging/log4j2-color.xml | 36 ++++++++++++++++++++ apache-maven/src/conf/logging/log4j2.xml | 36 ++++++++++++++++++++ maven-embedder/pom.xml | 8 +++++ .../maven/slf4j-configuration.properties | 2 +- pom.xml | 31 +++++++++++++++-- 6 files changed, 123 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven/blob/39308e68/apache-maven/pom.xml ---------------------------------------------------------------------- diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml index 11bbd4f..e3afbcc 100644 --- a/apache-maven/pom.xml +++ b/apache-maven/pom.xml @@ -89,7 +89,20 @@ </dependency> <dependency> <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> + <artifactId>slf4j-ext</artifactId> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-slf4j-impl</artifactId> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> + </dependency> + <dependency> + <groupId>org.fusesource.jansi</groupId> + <artifactId>jansi</artifactId> + <scope>runtime</scope> </dependency> </dependencies> http://git-wip-us.apache.org/repos/asf/maven/blob/39308e68/apache-maven/src/conf/logging/log4j2-color.xml ---------------------------------------------------------------------- diff --git a/apache-maven/src/conf/logging/log4j2-color.xml b/apache-maven/src/conf/logging/log4j2-color.xml new file mode 100644 index 0000000..bea1e76 --- /dev/null +++ b/apache-maven/src/conf/logging/log4j2-color.xml @@ -0,0 +1,36 @@ +<?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. + --> + + +<configuration> + <properties> + <property name="maven.logging.root.level">INFO</property> + </properties> + <appenders> + <Console name="console" target="SYSTEM_OUT"> + <PatternLayout pattern="%highlight{[%p{WARN=WARNING}]} %msg%n%throwable" /> + </Console> + </appenders> + <loggers> + <root level="${sys:maven.logging.root.level}"> + <appender-ref ref="console"/> + </root> + </loggers> +</configuration> http://git-wip-us.apache.org/repos/asf/maven/blob/39308e68/apache-maven/src/conf/logging/log4j2.xml ---------------------------------------------------------------------- diff --git a/apache-maven/src/conf/logging/log4j2.xml b/apache-maven/src/conf/logging/log4j2.xml new file mode 100644 index 0000000..6635597 --- /dev/null +++ b/apache-maven/src/conf/logging/log4j2.xml @@ -0,0 +1,36 @@ +<?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. + --> + + +<configuration> <!--status="debug"--> + <properties> + <property name="maven.logging.root.level">INFO</property> + </properties> + <appenders> + <Console name="console" target="SYSTEM_OUT"> + <PatternLayout pattern="[%p{WARN=WARNING}] %msg%n%throwable"/> + </Console> + </appenders> + <loggers> + <root level="${sys:maven.logging.root.level}"> + <appender-ref ref="console"/> + </root> + </loggers> +</configuration> http://git-wip-us.apache.org/repos/asf/maven/blob/39308e68/maven-embedder/pom.xml ---------------------------------------------------------------------- diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index e3c2028..607c6d4 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -76,6 +76,10 @@ </dependency> <dependency> <groupId>org.slf4j</groupId> + <artifactId>slf4j-ext</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <optional>true</optional> </dependency> @@ -84,6 +88,10 @@ <artifactId>logback-classic</artifactId> <optional>true</optional> </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-slf4j-impl</artifactId> + </dependency> <!-- CLI --> <dependency> <groupId>commons-cli</groupId> http://git-wip-us.apache.org/repos/asf/maven/blob/39308e68/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties ---------------------------------------------------------------------- diff --git a/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties b/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties index 8741836..cd01f9e 100644 --- a/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties +++ b/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties @@ -18,5 +18,5 @@ # key = Slf4j effective logger factory implementation # value = corresponding o.a.m.cli.logging.Slf4jConfiguration class org.slf4j.impl.SimpleLoggerFactory org.apache.maven.cli.logging.impl.Slf4jSimpleConfiguration -org.slf4j.helpers.Log4jLoggerFactory org.apache.maven.cli.logging.impl.Log4j2Configuration +org.apache.logging.slf4j.Log4jLoggerFactory org.apache.maven.cli.logging.impl.Log4j2Configuration ch.qos.logback.classic.LoggerContext org.apache.maven.cli.logging.impl.LogbackConfiguration http://git-wip-us.apache.org/repos/asf/maven/blob/39308e68/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index a9a0c33..4084a77 100644 --- a/pom.xml +++ b/pom.xml @@ -61,6 +61,9 @@ <jxpathVersion>1.3</jxpathVersion> <aetherVersion>1.0.2.v20150114</aetherVersion> <slf4jVersion>1.7.5</slf4jVersion> + <log4j2Version>2.4</log4j2Version> + <logbackVersion>1.0.7</logbackVersion> + <jansiVersion>1.11</jansiVersion> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile> <!-- Control the name of the distribution and information output by mvn --> <distributionId>apache-maven</distributionId> @@ -261,6 +264,7 @@ <artifactId>plexus-interpolation</artifactId> <version>${plexusInterpolationVersion}</version> </dependency> + <!-- Logging --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> @@ -270,13 +274,34 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>${slf4jVersion}</version> - <optional>true</optional> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> - <version>1.0.7</version> - <optional>true</optional> + <version>${logbackVersion}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-ext</artifactId> + <version>${slf4jVersion}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-slf4j-impl</artifactId> + <version>${log4j2Version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> + <version>${log4j2Version}</version> + </dependency> + <dependency> + <groupId>org.fusesource.jansi</groupId> + <artifactId>jansi</artifactId> + <version>${jansiVersion}</version> + <scope>runtime</scope> </dependency> <!-- Wagon --> <dependency>