This is an automated email from the ASF dual-hosted git repository. jgresock pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push: new 4bcd030 NIFI-9283 Excluded Log4j 1.2 and upgraded Log4j2 to 2.14.1 4bcd030 is described below commit 4bcd03024a419afdf40d464bda716f0b9d21925b Author: exceptionfactory <exceptionfact...@apache.org> AuthorDate: Mon Oct 4 20:10:20 2021 -0500 NIFI-9283 Excluded Log4j 1.2 and upgraded Log4j2 to 2.14.1 Signed-off-by: Joe Gresock <jgres...@gmail.com> This closes #5440. --- minifi/minifi-assembly/NOTICE | 5 -- minifi/minifi-c2/minifi-c2-assembly/NOTICE | 5 -- .../minifi-framework/minifi-server/pom.xml | 4 - .../minifi-toolkit/minifi-toolkit-assembly/NOTICE | 5 -- minifi/pom.xml | 6 -- nifi-commons/nifi-security-kerberos/pom.xml | 6 ++ nifi-external/nifi-spark-receiver/pom.xml | 14 +++ .../nifi-accumulo-processors/pom.xml | 8 ++ .../nifi-accumulo-services-api/pom.xml | 12 ++- nifi-nar-bundles/nifi-accumulo-bundle/pom.xml | 8 ++ .../nifi-atlas-reporting-task/pom.xml | 10 +++ .../nifi-druid-controller-service-api/pom.xml | 4 + nifi-nar-bundles/nifi-druid-bundle/pom.xml | 8 ++ .../nifi-elasticsearch-5-processors/pom.xml | 15 +++- .../src/test/resources/log4j.properties | 22 ----- .../nifi-elasticsearch-restapi-processors/pom.xml | 10 --- .../src/test/resources/log4j.properties | 22 ----- nifi-nar-bundles/nifi-elasticsearch-bundle/pom.xml | 8 ++ .../nifi-extension-utils/nifi-hadoop-utils/pom.xml | 26 ++++++ .../nifi-hadoop-record-utils/pom.xml | 10 +++ .../nifi-flume-processors/pom.xml | 24 ++++++ .../nifi-framework/nifi-headless-server/pom.xml | 4 - .../nifi-hdfs-processors/pom.xml | 16 ++++ .../nifi-hadoop-libraries-nar/pom.xml | 8 ++ .../nifi-hive-bundle/nifi-hive-processors/pom.xml | 38 +++++++++ .../nifi-hive-bundle/nifi-hive3-processors/pom.xml | 26 +++++- .../org/apache/nifi/processors/orc/PutORCTest.java | 2 - .../nifi-hive_1_1-processors/pom.xml | 42 +++++++++ nifi-nar-bundles/nifi-hive-bundle/pom.xml | 8 ++ .../nifi-kafka-0-10-processors/pom.xml | 12 +++ .../nifi-kafka-0-11-processors/pom.xml | 12 +++ .../nifi-kafka-0-8-processors/pom.xml | 12 +++ .../apache/nifi/processors/kafka/TestGetKafka.java | 29 ------- .../nifi-kafka-0-9-processors/pom.xml | 12 +++ .../nifi-kafka-1-0-processors/pom.xml | 12 +++ .../nifi-kite-bundle/nifi-kite-processors/pom.xml | 38 +++++++++ .../nifi-parquet-processors/pom.xml | 8 ++ .../nifi/processors/parquet/PutParquetTest.java | 7 -- .../nifi-ranger-bundle/nifi-ranger-plugin/pom.xml | 36 ++++++++ .../nifi-ranger-resources/pom.xml | 12 +++ nifi-nar-bundles/nifi-ranger-bundle/pom.xml | 8 ++ nifi-nar-bundles/nifi-standard-bundle/pom.xml | 6 ++ .../nifi-hadoop-dbcp-service/pom.xml | 4 + .../nifi-hbase_1_1_2-client-service/pom.xml | 8 ++ .../nifi-hbase_2-client-service/pom.xml | 8 ++ .../nifi-registry-ranger-plugin/pom.xml | 30 +++++++ .../nifi-registry-ranger/pom.xml | 8 ++ .../src/main/resources/classpath/log4j.properties | 24 ------ .../nifi/toolkit/encryptconfig/DecryptMode.groovy | 2 - .../encryptconfig/EncryptConfigLogger.groovy | 86 ------------------- .../encryptconfig/NiFiRegistryDecryptMode.groovy | 1 - .../toolkit/encryptconfig/NiFiRegistryMode.groovy | 1 - .../src/main/resources/log4j.properties | 23 ----- .../properties/ConfigEncryptionToolTest.groovy | 99 ---------------------- .../src/test/resources/log4j.properties | 27 ------ .../src/test/resources/log4j.properties | 22 ----- .../src/test/resources/log4j.properties | 24 ------ nifi-toolkit/pom.xml | 2 +- pom.xml | 2 + 59 files changed, 512 insertions(+), 439 deletions(-) diff --git a/minifi/minifi-assembly/NOTICE b/minifi/minifi-assembly/NOTICE index 0dcf0d1..422185c 100644 --- a/minifi/minifi-assembly/NOTICE +++ b/minifi/minifi-assembly/NOTICE @@ -247,11 +247,6 @@ The following binary components are provided under the Apache Software License v by an original code donated by Sébastien Brisard. =============================================================================== - (ASLv2) Apache log4j - The following NOTICE information applies: - Apache log4j - Copyright 2007 The Apache Software Foundation - (ASLv2) Apache Tika The following NOTICE information applies: Apache Tika diff --git a/minifi/minifi-c2/minifi-c2-assembly/NOTICE b/minifi/minifi-c2/minifi-c2-assembly/NOTICE index 4bf426f..fc7727f 100644 --- a/minifi/minifi-c2/minifi-c2-assembly/NOTICE +++ b/minifi/minifi-c2/minifi-c2-assembly/NOTICE @@ -196,11 +196,6 @@ The following binary components are provided under the Apache Software License v Apache ZooKeeper Copyright 2009-2012 The Apache Software Foundation - (ASLv2) Apache log4j - The following NOTICE information applies: - Apache log4j - Copyright 2007 The Apache Software Foundation - (ASLv2) The Netty Project The following NOTICE information applies: The Netty Project diff --git a/minifi/minifi-nar-bundles/minifi-framework-bundle/minifi-framework/minifi-server/pom.xml b/minifi/minifi-nar-bundles/minifi-framework-bundle/minifi-framework/minifi-server/pom.xml index 48e0269..1afd7ac 100644 --- a/minifi/minifi-nar-bundles/minifi-framework-bundle/minifi-framework/minifi-server/pom.xml +++ b/minifi/minifi-nar-bundles/minifi-framework-bundle/minifi-framework/minifi-server/pom.xml @@ -24,10 +24,6 @@ <packaging>jar</packaging> <dependencies> <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - </dependency> - <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-api</artifactId> <scope>provided</scope> diff --git a/minifi/minifi-toolkit/minifi-toolkit-assembly/NOTICE b/minifi/minifi-toolkit/minifi-toolkit-assembly/NOTICE index 0ff7d5e..5cb578c 100644 --- a/minifi/minifi-toolkit/minifi-toolkit-assembly/NOTICE +++ b/minifi/minifi-toolkit/minifi-toolkit-assembly/NOTICE @@ -145,11 +145,6 @@ The following binary components are provided under the Apache Software License v Apache ZooKeeper Copyright 2009-2012 The Apache Software Foundation - (ASLv2) Apache log4j - The following NOTICE information applies: - Apache log4j - Copyright 2007 The Apache Software Foundation - (ASLv2) The Netty Project The following NOTICE information applies: The Netty Project diff --git a/minifi/pom.xml b/minifi/pom.xml index 3414616..18a35db 100644 --- a/minifi/pom.xml +++ b/minifi/pom.xml @@ -985,12 +985,6 @@ limitations under the License. <artifactId>curator-recipes</artifactId> <version>2.11.0</version> </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>${org.slf4j.version}</version> - </dependency> - <!-- Test Dependencies for testing interactions with ZooKeeper --> <dependency> diff --git a/nifi-commons/nifi-security-kerberos/pom.xml b/nifi-commons/nifi-security-kerberos/pom.xml index 37afd13..e965361 100644 --- a/nifi-commons/nifi-security-kerberos/pom.xml +++ b/nifi-commons/nifi-security-kerberos/pom.xml @@ -46,6 +46,12 @@ <artifactId>hadoop-minikdc</artifactId> <version>3.1.0</version> <scope>test</scope> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> </dependency> </dependencies> </project> diff --git a/nifi-external/nifi-spark-receiver/pom.xml b/nifi-external/nifi-spark-receiver/pom.xml index 25f2c79..a8c3285 100644 --- a/nifi-external/nifi-spark-receiver/pom.xml +++ b/nifi-external/nifi-spark-receiver/pom.xml @@ -50,6 +50,20 @@ <artifactId>spark-streaming_2.10</artifactId> <scope>provided</scope> <version>1.6.0</version> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> </dependency> <dependency> <groupId>org.apache.nifi</groupId> diff --git a/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-processors/pom.xml b/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-processors/pom.xml index 942c071..786d7cd 100644 --- a/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-processors/pom.xml +++ b/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-processors/pom.xml @@ -38,6 +38,10 @@ <artifactId>accumulo-core</artifactId> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.9</version> @@ -89,6 +93,10 @@ <groupId>org.hibernate.validator</groupId> <artifactId>hibernate-validator</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> </exclusions> </dependency> <dependency> diff --git a/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-services-api/pom.xml b/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-services-api/pom.xml index 05b9cd7..8727664 100644 --- a/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-services-api/pom.xml +++ b/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-services-api/pom.xml @@ -26,10 +26,14 @@ <packaging>jar</packaging> <dependencies> - <dependency> - <groupId>org.apache.accumulo</groupId> - <artifactId>accumulo-core</artifactId> - </dependency> + <dependency> + <groupId>org.apache.accumulo</groupId> + <artifactId>accumulo-core</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> diff --git a/nifi-nar-bundles/nifi-accumulo-bundle/pom.xml b/nifi-nar-bundles/nifi-accumulo-bundle/pom.xml index 4b4b42a..2ebae34 100644 --- a/nifi-nar-bundles/nifi-accumulo-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-accumulo-bundle/pom.xml @@ -64,6 +64,14 @@ <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-annotations</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> </exclusions> </dependency> </dependencies> diff --git a/nifi-nar-bundles/nifi-atlas-bundle/nifi-atlas-reporting-task/pom.xml b/nifi-nar-bundles/nifi-atlas-bundle/nifi-atlas-reporting-task/pom.xml index 905355b..dcf37e2 100644 --- a/nifi-nar-bundles/nifi-atlas-bundle/nifi-atlas-reporting-task/pom.xml +++ b/nifi-nar-bundles/nifi-atlas-bundle/nifi-atlas-reporting-task/pom.xml @@ -31,6 +31,10 @@ <artifactId>nifi-api</artifactId> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-processor-utils</artifactId> <version>1.15.0-SNAPSHOT</version> @@ -60,6 +64,12 @@ <dependency> <groupId>org.apache.atlas</groupId> <artifactId>atlas-client-v2</artifactId> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.atlas</groupId> diff --git a/nifi-nar-bundles/nifi-druid-bundle/nifi-druid-controller-service-api/pom.xml b/nifi-nar-bundles/nifi-druid-bundle/nifi-druid-controller-service-api/pom.xml index 5ca2d45..e241dfb 100644 --- a/nifi-nar-bundles/nifi-druid-bundle/nifi-druid-controller-service-api/pom.xml +++ b/nifi-nar-bundles/nifi-druid-bundle/nifi-druid-controller-service-api/pom.xml @@ -137,5 +137,9 @@ <artifactId>bcprov-jdk15on</artifactId> <scope>provided</scope> </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> </dependencies> </project> \ No newline at end of file diff --git a/nifi-nar-bundles/nifi-druid-bundle/pom.xml b/nifi-nar-bundles/nifi-druid-bundle/pom.xml index a3cfc9d..3c8155d 100644 --- a/nifi-nar-bundles/nifi-druid-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-druid-bundle/pom.xml @@ -70,6 +70,14 @@ <artifactId>snakeyaml</artifactId> <version>1.29</version> </dependency> + <!-- Override log4j 2.5 from druid --> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-bom</artifactId> + <version>2.14.1</version> + <scope>import</scope> + <type>pom</type> + </dependency> </dependencies> </dependencyManagement> diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-5-processors/pom.xml b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-5-processors/pom.xml index 5f77a50..a1c61c3 100644 --- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-5-processors/pom.xml +++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-5-processors/pom.xml @@ -24,6 +24,7 @@ language governing permissions and limitations under the License. --> <slf4jversion>2.7</slf4jversion> <es.version>5.0.1</es.version> <lucene.version>6.2.1</lucene.version> + <log4j.version>2.14.1</log4j.version> </properties> <dependencies> @@ -57,6 +58,12 @@ language governing permissions and limitations under the License. --> <groupId>org.elasticsearch.client</groupId> <artifactId>rest</artifactId> <version>${es.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.nifi</groupId> @@ -68,14 +75,18 @@ language governing permissions and limitations under the License. --> <version>2.10.0</version> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> - <version>2.8.2</version> + <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <version>2.13.3</version> + <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.apache.nifi</groupId> diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-5-processors/src/test/resources/log4j.properties b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-5-processors/src/test/resources/log4j.properties deleted file mode 100644 index cc58727..0000000 --- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-5-processors/src/test/resources/log4j.properties +++ /dev/null @@ -1,22 +0,0 @@ -# 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. -log4j.rootLogger=INFO, CONSOLE - -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender - -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x \u2013 %m%n - -log4j.logger.org.apache.flume = DEBUG \ No newline at end of file diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/pom.xml b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/pom.xml index fd0df9d..fa874fb 100644 --- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/pom.xml +++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/pom.xml @@ -67,16 +67,6 @@ language governing permissions and limitations under the License. --> <version>2.10.0</version> </dependency> <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-api</artifactId> - <version>2.8.2</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>2.13.3</version> - </dependency> - <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-ssl-context-service</artifactId> <version>1.15.0-SNAPSHOT</version> diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/test/resources/log4j.properties b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/test/resources/log4j.properties deleted file mode 100644 index cc58727..0000000 --- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/test/resources/log4j.properties +++ /dev/null @@ -1,22 +0,0 @@ -# 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. -log4j.rootLogger=INFO, CONSOLE - -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender - -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x \u2013 %m%n - -log4j.logger.org.apache.flume = DEBUG \ No newline at end of file diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/pom.xml b/nifi-nar-bundles/nifi-elasticsearch-bundle/pom.xml index f06a01f..92e916b 100644 --- a/nifi-nar-bundles/nifi-elasticsearch-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/pom.xml @@ -64,6 +64,14 @@ language governing permissions and limitations under the License. --> <artifactId>commons-compress</artifactId> <version>1.21</version> </dependency> + <!-- Override log4j 2.11.1 --> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-bom</artifactId> + <version>2.14.1</version> + <scope>import</scope> + <type>pom</type> + </dependency> </dependencies> </dependencyManagement> diff --git a/nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/pom.xml b/nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/pom.xml index c5ae812..bbece5c 100644 --- a/nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/pom.xml +++ b/nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/pom.xml @@ -58,12 +58,32 @@ <artifactId>hadoop-common</artifactId> <version>${hadoop.version}</version> <scope>provided</scope> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-auth</artifactId> <version>${hadoop.version}</version> <scope>provided</scope> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> @@ -87,6 +107,12 @@ <artifactId>hadoop-minikdc</artifactId> <version>3.2.0</version> <scope>test</scope> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> </dependency> </dependencies> <dependencyManagement> diff --git a/nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-hadoop-record-utils/pom.xml b/nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-hadoop-record-utils/pom.xml index a911297..38c2ee9 100644 --- a/nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-hadoop-record-utils/pom.xml +++ b/nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-hadoop-record-utils/pom.xml @@ -61,6 +61,16 @@ <artifactId>hadoop-common</artifactId> <version>${hadoop.version}</version> <scope>provided</scope> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.nifi</groupId> diff --git a/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-processors/pom.xml b/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-processors/pom.xml index 0b57003..9843088 100644 --- a/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-processors/pom.xml +++ b/nifi-nar-bundles/nifi-flume-bundle/nifi-flume-processors/pom.xml @@ -33,6 +33,10 @@ <artifactId>nifi-api</artifactId> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-utils</artifactId> <version>1.15.0-SNAPSHOT</version> @@ -56,6 +60,10 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> </exclusions> </dependency> @@ -70,6 +78,12 @@ <groupId>org.apache.flume.flume-ng-sources</groupId> <artifactId>flume-kafka-source</artifactId> <version>${flume.version}</version> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.flume.flume-ng-sources</groupId> @@ -111,6 +125,10 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -118,6 +136,12 @@ <artifactId>hadoop-hdfs</artifactId> <version>${hadoop.version}</version> <scope>provided</scope> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-headless-server/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-headless-server/pom.xml index d7af947..9d8258d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-headless-server/pom.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-headless-server/pom.xml @@ -24,10 +24,6 @@ <packaging>jar</packaging> <dependencies> <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - </dependency> - <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-api</artifactId> <scope>provided</scope> diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml index cff199a..98538ec 100644 --- a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml +++ b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml @@ -47,12 +47,28 @@ <artifactId>hadoop-common</artifactId> <version>${hadoop.version}</version> <scope>provided</scope> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-hdfs</artifactId> <version>${hadoop.version}</version> <scope>provided</scope> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> diff --git a/nifi-nar-bundles/nifi-hadoop-libraries-bundle/nifi-hadoop-libraries-nar/pom.xml b/nifi-nar-bundles/nifi-hadoop-libraries-bundle/nifi-hadoop-libraries-nar/pom.xml index 069baf7..ae8b974 100644 --- a/nifi-nar-bundles/nifi-hadoop-libraries-bundle/nifi-hadoop-libraries-nar/pom.xml +++ b/nifi-nar-bundles/nifi-hadoop-libraries-bundle/nifi-hadoop-libraries-nar/pom.xml @@ -38,9 +38,17 @@ <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> </exclusions> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.avro</groupId> <artifactId>avro</artifactId> <version>${avro.version}</version> diff --git a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/pom.xml b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/pom.xml index 777a5ab..40059b4 100644 --- a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/pom.xml +++ b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/pom.xml @@ -72,6 +72,18 @@ <groupId>org.json</groupId> <artifactId>json</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>apache-log4j-extras</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -83,6 +95,14 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>apache-log4j-extras</artifactId> + </exclusion> </exclusions> </dependency> <!-- Override groovy-all:2.1.6 from Hive --> @@ -95,6 +115,12 @@ <groupId>org.apache.hive.hcatalog</groupId> <artifactId>hive-hcatalog-core</artifactId> <version>${hive12.version}</version> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> @@ -105,6 +131,14 @@ <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -133,6 +167,10 @@ <version>2.7.0</version> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-mock</artifactId> <version>1.15.0-SNAPSHOT</version> diff --git a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml index e4f62c0..bb0b10d 100644 --- a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml +++ b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml @@ -80,13 +80,21 @@ <version>${hive.version}</version> <exclusions> <exclusion> - <groupId>org.json</groupId> - <artifactId>json</artifactId> + <groupId>org.json</groupId> + <artifactId>json</artifactId> </exclusion> <exclusion> <groupId>org.apache.hbase</groupId> <artifactId>hbase-server</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -98,12 +106,22 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.hive.hcatalog</groupId> <artifactId>hive-hcatalog-core</artifactId> <version>${hive.version}</version> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> </dependency> <!-- Override groovy-all:2.4.11 from Hive --> <dependency> @@ -139,6 +157,10 @@ <version>2.7.0</version> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-all</artifactId> <scope>test</scope> diff --git a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/test/java/org/apache/nifi/processors/orc/PutORCTest.java b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/test/java/org/apache/nifi/processors/orc/PutORCTest.java index b8ed6c2..109dc7d 100644 --- a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/test/java/org/apache/nifi/processors/orc/PutORCTest.java +++ b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/test/java/org/apache/nifi/processors/orc/PutORCTest.java @@ -34,7 +34,6 @@ import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils; import org.apache.hadoop.io.IntWritable; -import org.apache.log4j.BasicConfigurator; import org.apache.nifi.avro.AvroTypeUtil; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; @@ -100,7 +99,6 @@ public class PutORCTest { @BeforeClass public static void setupBeforeClass() { Assume.assumeTrue("Test only runs on *nix", !SystemUtils.IS_OS_WINDOWS); - BasicConfigurator.configure(); } @Before diff --git a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive_1_1-processors/pom.xml b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive_1_1-processors/pom.xml index d00eb17..610823e 100644 --- a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive_1_1-processors/pom.xml +++ b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive_1_1-processors/pom.xml @@ -82,6 +82,18 @@ <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>apache-log4j-extras</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -93,12 +105,26 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>apache-log4j-extras</artifactId> + </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.hive.hcatalog</groupId> <artifactId>hive-hcatalog-core</artifactId> <version>${hive11.version}</version> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> @@ -109,6 +135,18 @@ <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>apache-log4j-extras</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -137,6 +175,10 @@ <version>2.7.0</version> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-mock</artifactId> <version>1.15.0-SNAPSHOT</version> diff --git a/nifi-nar-bundles/nifi-hive-bundle/pom.xml b/nifi-nar-bundles/nifi-hive-bundle/pom.xml index dc4f8ae..c390d66 100644 --- a/nifi-nar-bundles/nifi-hive-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-hive-bundle/pom.xml @@ -97,6 +97,14 @@ <artifactId>derby</artifactId> <version>10.14.2.0</version> </dependency> + <!-- Override log4j 2.10.0 --> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-bom</artifactId> + <version>2.14.1</version> + <scope>import</scope> + <type>pom</type> + </dependency> </dependencies> </dependencyManagement> diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-10-processors/pom.xml b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-10-processors/pom.xml index ec067ec..a41b216 100644 --- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-10-processors/pom.xml +++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-10-processors/pom.xml @@ -27,6 +27,10 @@ <artifactId>nifi-api</artifactId> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-record-serialization-service-api</artifactId> </dependency> @@ -78,6 +82,14 @@ <groupId>com.sun.jmx</groupId> <artifactId>jmxri</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> </exclusions> </dependency> <dependency> diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-11-processors/pom.xml b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-11-processors/pom.xml index 74734b1..40ef6f8 100644 --- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-11-processors/pom.xml +++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-11-processors/pom.xml @@ -27,6 +27,10 @@ <artifactId>nifi-api</artifactId> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-record-serialization-service-api</artifactId> </dependency> @@ -77,6 +81,14 @@ <groupId>com.sun.jmx</groupId> <artifactId>jmxri</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> </exclusions> </dependency> <dependency> diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-processors/pom.xml b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-processors/pom.xml index 78f7d53..0fb53a8 100644 --- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-processors/pom.xml +++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-processors/pom.xml @@ -27,6 +27,10 @@ <artifactId>nifi-api</artifactId> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-processor-utils</artifactId> <version>1.15.0-SNAPSHOT</version> @@ -60,6 +64,14 @@ <groupId>com.sun.jmx</groupId> <artifactId>jmxri</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> </exclusions> </dependency> <dependency> diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-processors/src/test/java/org/apache/nifi/processors/kafka/TestGetKafka.java b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-processors/src/test/java/org/apache/nifi/processors/kafka/TestGetKafka.java index dfcf0d9..40c1b08 100644 --- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-processors/src/test/java/org/apache/nifi/processors/kafka/TestGetKafka.java +++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-processors/src/test/java/org/apache/nifi/processors/kafka/TestGetKafka.java @@ -22,13 +22,10 @@ import java.util.Iterator; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.log4j.BasicConfigurator; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.util.MockFlowFile; import org.apache.nifi.util.TestRunner; import org.apache.nifi.util.TestRunners; -import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; @@ -39,32 +36,6 @@ import kafka.message.MessageAndMetadata; public class TestGetKafka { - @BeforeClass - public static void configureLogging() { - System.setProperty("org.slf4j.simpleLogger.log.kafka", "INFO"); - System.setProperty("org.slf4j.simpleLogger.log.org.apache.nifi.processors.kafka", "INFO"); - BasicConfigurator.configure(); - } - - @Test - @Ignore("Intended only for local tests to verify functionality.") - public void testIntegrationLocally() { - final TestRunner runner = TestRunners.newTestRunner(GetKafka.class); - runner.setProperty(GetKafka.ZOOKEEPER_CONNECTION_STRING, "192.168.0.101:2181"); - runner.setProperty(GetKafka.TOPIC, "testX"); - runner.setProperty(GetKafka.KAFKA_TIMEOUT, "3 secs"); - runner.setProperty(GetKafka.ZOOKEEPER_TIMEOUT, "3 secs"); - - runner.run(20, false); - - final List<MockFlowFile> flowFiles = runner.getFlowFilesForRelationship(GetKafka.REL_SUCCESS); - for (final MockFlowFile flowFile : flowFiles) { - System.out.println(flowFile.getAttributes()); - System.out.println(new String(flowFile.toByteArray())); - System.out.println(); - } - } - @Test public void testWithDelimiter() { final List<String> messages = new ArrayList<>(); diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-9-processors/pom.xml b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-9-processors/pom.xml index 7958049..9a57b84 100644 --- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-9-processors/pom.xml +++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-9-processors/pom.xml @@ -27,6 +27,10 @@ <artifactId>nifi-api</artifactId> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-processor-utils</artifactId> <version>1.15.0-SNAPSHOT</version> @@ -65,6 +69,14 @@ <groupId>com.sun.jmx</groupId> <artifactId>jmxri</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> </exclusions> </dependency> <dependency> diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-1-0-processors/pom.xml b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-1-0-processors/pom.xml index c971873..b8ecf1a 100644 --- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-1-0-processors/pom.xml +++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-1-0-processors/pom.xml @@ -27,6 +27,10 @@ <artifactId>nifi-api</artifactId> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-record-serialization-service-api</artifactId> </dependency> @@ -82,6 +86,14 @@ <groupId>com.sun.jmx</groupId> <artifactId>jmxri</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> </exclusions> </dependency> <dependency> diff --git a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml index cd45ea1..e04e78e 100644 --- a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml +++ b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml @@ -95,6 +95,14 @@ <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-jobclient</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> </exclusions> </dependency> @@ -180,6 +188,18 @@ <groupId>jline</groupId> <artifactId>jline</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>apache-log4j-extras</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> </exclusions> </dependency> @@ -188,6 +208,10 @@ <artifactId>guava</artifactId> <version>28.0-jre</version> </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> <dependency> <!-- avoid warnings by bundling annotations --> @@ -274,6 +298,20 @@ <type>pom</type> <scope>test</scope> <version>${kite.version}</version> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>apache-log4j-extras</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.nifi</groupId> diff --git a/nifi-nar-bundles/nifi-parquet-bundle/nifi-parquet-processors/pom.xml b/nifi-nar-bundles/nifi-parquet-bundle/nifi-parquet-processors/pom.xml index aabfc82..034810c 100644 --- a/nifi-nar-bundles/nifi-parquet-bundle/nifi-parquet-processors/pom.xml +++ b/nifi-nar-bundles/nifi-parquet-bundle/nifi-parquet-processors/pom.xml @@ -30,6 +30,10 @@ <artifactId>nifi-api</artifactId> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.nifi</groupId> <artifactId>nifi-utils</artifactId> <version>1.15.0-SNAPSHOT</version> @@ -45,6 +49,10 @@ <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </exclusion> diff --git a/nifi-nar-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/test/java/org/apache/nifi/processors/parquet/PutParquetTest.java b/nifi-nar-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/test/java/org/apache/nifi/processors/parquet/PutParquetTest.java index 3c77aff..302e36a 100644 --- a/nifi-nar-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/test/java/org/apache/nifi/processors/parquet/PutParquetTest.java +++ b/nifi-nar-bundles/nifi-parquet-bundle/nifi-parquet-processors/src/test/java/org/apache/nifi/processors/parquet/PutParquetTest.java @@ -38,7 +38,6 @@ import org.apache.commons.io.IOUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.log4j.BasicConfigurator; import org.apache.nifi.avro.AvroTypeUtil; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; @@ -65,7 +64,6 @@ import org.apache.parquet.avro.AvroParquetReader; import org.apache.parquet.hadoop.ParquetReader; import org.apache.parquet.hadoop.metadata.CompressionCodecName; import org.apache.parquet.hadoop.util.HadoopInputFile; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnOs; @@ -84,11 +82,6 @@ public class PutParquetTest { private MockRecordParser readerFactory; private TestRunner testRunner; - @BeforeAll - public static void setupBeforeClass() { - BasicConfigurator.configure(); - } - @BeforeEach public void setup() throws IOException { final String avroSchema = IOUtils.toString(new FileInputStream("src/test/resources/avro/user.avsc"), StandardCharsets.UTF_8); diff --git a/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/pom.xml b/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/pom.xml index a90e5d2..578130f 100644 --- a/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/pom.xml +++ b/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/pom.xml @@ -37,6 +37,10 @@ <artifactId>nifi-properties</artifactId> </dependency> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.ranger</groupId> <artifactId>ranger-plugins-common</artifactId> <version>${ranger.version}</version> @@ -46,6 +50,10 @@ <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> </exclusion> @@ -60,6 +68,10 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -87,6 +99,12 @@ <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-client</artifactId> <version>${ranger.hadoop.version}</version> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> </dependency> <!-- hadoop-common and hadoop-auth are transitive dependencies of ranger client, but we need to make sure they are the same version as hadoop-client above --> @@ -99,6 +117,14 @@ <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -110,6 +136,16 @@ <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-auth</artifactId> <version>${ranger.hadoop.version}</version> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.nifi</groupId> diff --git a/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-resources/pom.xml b/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-resources/pom.xml index dbe4fd8..9564c7d 100644 --- a/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-resources/pom.xml +++ b/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-resources/pom.xml @@ -27,6 +27,10 @@ <dependencies> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> + <dependency> <groupId>org.apache.ranger</groupId> <artifactId>credentialbuilder</artifactId> <version>${ranger.version}</version> @@ -35,6 +39,14 @@ <groupId>commons-configuration</groupId> <artifactId>commons-configuration</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> </exclusions> </dependency> <dependency> diff --git a/nifi-nar-bundles/nifi-ranger-bundle/pom.xml b/nifi-nar-bundles/nifi-ranger-bundle/pom.xml index 3b98cdf..a1911f1 100644 --- a/nifi-nar-bundles/nifi-ranger-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-ranger-bundle/pom.xml @@ -65,6 +65,14 @@ <artifactId>jackson-databind</artifactId> <version>${jackson.version}</version> </dependency> + <!-- Override log4j 2.11.1 --> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-bom</artifactId> + <version>2.14.1</version> + <scope>import</scope> + <type>pom</type> + </dependency> </dependencies> </dependencyManagement> </project> diff --git a/nifi-nar-bundles/nifi-standard-bundle/pom.xml b/nifi-nar-bundles/nifi-standard-bundle/pom.xml index 58ab293..6121f32 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-standard-bundle/pom.xml @@ -365,6 +365,12 @@ <groupId>org.apache.calcite</groupId> <artifactId>calcite-core</artifactId> <version>1.27.0</version> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.avro</groupId> diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hadoop-dbcp-service-bundle/nifi-hadoop-dbcp-service/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-hadoop-dbcp-service-bundle/nifi-hadoop-dbcp-service/pom.xml index f4ecfb2..40b44cb 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-hadoop-dbcp-service-bundle/nifi-hadoop-dbcp-service/pom.xml +++ b/nifi-nar-bundles/nifi-standard-services/nifi-hadoop-dbcp-service-bundle/nifi-hadoop-dbcp-service/pom.xml @@ -77,6 +77,10 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> </exclusions> </dependency> <!-- Test Dependencies --> diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/pom.xml index af692dc..c13ddd0 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/pom.xml +++ b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/pom.xml @@ -87,6 +87,10 @@ <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> </exclusion> @@ -137,6 +141,10 @@ <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> </exclusion> diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_2-client-service-bundle/nifi-hbase_2-client-service/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_2-client-service-bundle/nifi-hbase_2-client-service/pom.xml index 2649c81..0d97447 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_2-client-service-bundle/nifi-hbase_2-client-service/pom.xml +++ b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_2-client-service-bundle/nifi-hbase_2-client-service/pom.xml @@ -84,6 +84,10 @@ <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> </exclusion> @@ -134,6 +138,10 @@ <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> </exclusion> diff --git a/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/pom.xml b/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/pom.xml index e6c9075..dbd1fee 100644 --- a/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/pom.xml +++ b/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/nifi-registry-ranger-plugin/pom.xml @@ -66,6 +66,10 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + </dependency> <!-- Ranger dependencies --> <dependency> @@ -78,6 +82,10 @@ <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> </exclusion> @@ -103,6 +111,10 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -174,12 +186,30 @@ <groupId>com.sun.jersey</groupId> <artifactId>jersey-core</artifactId> </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-auth</artifactId> <version>${ranger.hadoop.version}</version> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> </dependency> <!-- Followings are required by com.sun.jersey.core.spi.factory.MessageBodyFactory --> diff --git a/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/pom.xml b/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/pom.xml index e9edf4b..8228b16 100644 --- a/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/pom.xml +++ b/nifi-registry/nifi-registry-extensions/nifi-registry-ranger/pom.xml @@ -77,6 +77,14 @@ <artifactId>jetty-webapp</artifactId> <version>${jetty.version}</version> </dependency> + <!-- Override log4j 2.11.1 --> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-bom</artifactId> + <version>2.14.1</version> + <scope>import</scope> + <type>pom</type> + </dependency> </dependencies> </dependencyManagement> </project> \ No newline at end of file diff --git a/nifi-toolkit/nifi-toolkit-assembly/src/main/resources/classpath/log4j.properties b/nifi-toolkit/nifi-toolkit-assembly/src/main/resources/classpath/log4j.properties deleted file mode 100644 index 6072b3e..0000000 --- a/nifi-toolkit/nifi-toolkit-assembly/src/main/resources/classpath/log4j.properties +++ /dev/null @@ -1,24 +0,0 @@ -# -# 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. -# - -log4j.rootLogger=INFO,console - -log4j.logger.org.apache.zookeeper=WARN,console - -log4j.appender.console=org.apache.log4j.ConsoleAppender -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss} %p [%t] %c: %m%n \ No newline at end of file diff --git a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/DecryptMode.groovy b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/DecryptMode.groovy index 1dc010a..1fbf8e7 100644 --- a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/DecryptMode.groovy +++ b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/DecryptMode.groovy @@ -75,8 +75,6 @@ class DecryptMode implements ToolMode { if (options.v) { verboseEnabled = true } - EncryptConfigLogger.configureLogger(verboseEnabled) - DecryptConfiguration config = new DecryptConfiguration(options) run(config) diff --git a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/EncryptConfigLogger.groovy b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/EncryptConfigLogger.groovy deleted file mode 100644 index 98a0944..0000000 --- a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/EncryptConfigLogger.groovy +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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. - */ -package org.apache.nifi.toolkit.encryptconfig - -import org.apache.log4j.LogManager -import org.apache.log4j.PropertyConfigurator -import org.slf4j.Logger -import org.slf4j.LoggerFactory - -class EncryptConfigLogger { - private static final Logger logger = LoggerFactory.getLogger(EncryptConfigLogger.class) - - /** - * Configures the logger. - * - * The nifi-toolkit module uses log4j, which will be configured to append all - * log output to the system STDERR. The log level can be specified using the verboseEnabled - * argument. A value of <code>true</code> will set the log level to DEBUG, a value of - * <code>false</code> will set the log level to INFO. - * - * @param verboseEnabled flag to indicate if verbose mode is enabled, which sets the log level to DEBUG - */ - static configureLogger(boolean verboseEnabled) { - - Properties log4jProps = null - URL log4jPropsPath = EncryptConfigLogger.class.getResource("/log4j.properties") - if (log4jPropsPath) { - try { - log4jPropsPath.withReader { reader -> - log4jProps = new Properties() - log4jProps.load(reader) - } - } catch (IOException e) { - // do nothing, we will fallback to hardcoded defaults below - } - } - - if (!log4jProps) { - log4jProps = defaultProperties() - } - - // For encrypt-config, log output should go to System.err as System.out is used for tool output in decrypt mode - log4jProps.put("log4j.appender.console.Target", "System.err") - - if (verboseEnabled) { - // Override the log level for this package. For this to work as intended, this class must belong - // to the same package (or a parent package) of all the encrypt-config classes - log4jProps.put("log4j.logger." + EncryptConfigLogger.class.package.name, "DEBUG") - } - - LogManager.resetConfiguration() - PropertyConfigurator.configure(log4jProps) - - if (verboseEnabled) { - logger.debug("Verbose mode is enabled (goes to stderr by default).") - } - } - - /** - * A copy of the settings in /src/main/resources/log4j.properties, in case that is not on the classpath at runtime - * @return Properties containing the default properties for Log4j - */ - static Properties defaultProperties() { - Properties defaultProperties = new Properties() - defaultProperties.setProperty("log4j.rootLogger", "INFO,console") - defaultProperties.setProperty("log4j.appender.console", "org.apache.log4j.ConsoleAppender") - defaultProperties.setProperty("log4j.appender.console.Target", "System.err") - defaultProperties.setProperty("log4j.appender.console.layout", "org.apache.log4j.PatternLayout") - defaultProperties.setProperty("log4j.appender.console.layout.ConversionPattern", "%d{yyyy-mm-dd HH:mm:ss} %p %c{1}: %m%n") - return defaultProperties - } -} diff --git a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/NiFiRegistryDecryptMode.groovy b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/NiFiRegistryDecryptMode.groovy index b8433cf..4fc52aa 100644 --- a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/NiFiRegistryDecryptMode.groovy +++ b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/NiFiRegistryDecryptMode.groovy @@ -52,7 +52,6 @@ class NiFiRegistryDecryptMode extends DecryptMode { if (options.v) { verboseEnabled = true } - EncryptConfigLogger.configureLogger(verboseEnabled) DecryptConfiguration config = new DecryptConfiguration() diff --git a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/NiFiRegistryMode.groovy b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/NiFiRegistryMode.groovy index bb174b0..a4f8c90 100644 --- a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/NiFiRegistryMode.groovy +++ b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/NiFiRegistryMode.groovy @@ -78,7 +78,6 @@ class NiFiRegistryMode implements ToolMode { if (options.v) { verboseEnabled = true } - EncryptConfigLogger.configureLogger(verboseEnabled) NiFiRegistryConfiguration config = new NiFiRegistryConfiguration(options) run(config) diff --git a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/resources/log4j.properties b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/resources/log4j.properties deleted file mode 100644 index 9a13479..0000000 --- a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/resources/log4j.properties +++ /dev/null @@ -1,23 +0,0 @@ -# -# 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. -# - -log4j.rootLogger=INFO,console - -log4j.appender.console=org.apache.log4j.ConsoleAppender -log4j.appender.console.Target=System.err -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p %c{1}: %m%n diff --git a/nifi-toolkit/nifi-toolkit-encrypt-config/src/test/groovy/org/apache/nifi/properties/ConfigEncryptionToolTest.groovy b/nifi-toolkit/nifi-toolkit-encrypt-config/src/test/groovy/org/apache/nifi/properties/ConfigEncryptionToolTest.groovy index 580cddc..6821565 100644 --- a/nifi-toolkit/nifi-toolkit-encrypt-config/src/test/groovy/org/apache/nifi/properties/ConfigEncryptionToolTest.groovy +++ b/nifi-toolkit/nifi-toolkit-encrypt-config/src/test/groovy/org/apache/nifi/properties/ConfigEncryptionToolTest.groovy @@ -21,8 +21,6 @@ import org.apache.commons.cli.CommandLineParser import org.apache.commons.cli.DefaultParser import org.apache.commons.io.IOUtils import org.apache.commons.lang3.SystemUtils -import org.apache.log4j.AppenderSkeleton -import org.apache.log4j.spi.LoggingEvent import org.apache.nifi.security.util.EncryptionMethod import org.apache.nifi.toolkit.tls.commandLine.CommandLineParseException import org.apache.nifi.util.NiFiProperties @@ -121,7 +119,6 @@ class ConfigEncryptionToolTest extends GroovyTestCase { @After void tearDown() throws Exception { System.clearProperty(NiFiProperties.PROPERTIES_FILE_PATH) - TestAppender.reset() } private static boolean isUnlimitedStrengthCryptoAvailable() { @@ -269,14 +266,6 @@ class ConfigEncryptionToolTest extends GroovyTestCase { // Act tool.parse("-n ${niFiPropertiesPath} -o ${niFiPropertiesPath}".split(" ") as String[]) - logger.info("Parsed nifi.properties location: ${tool.niFiPropertiesPath}") - logger.info("Parsed output nifi.properties location: ${tool.outputNiFiPropertiesPath}") - - // Assert - assert !TestAppender.events.isEmpty() - assert TestAppender.events.stream().any() { - it.message =~ "The source nifi.properties and destination nifi.properties are identical \\[.*\\] so the original will be overwritten" - } } @Test @@ -322,14 +311,6 @@ class ConfigEncryptionToolTest extends GroovyTestCase { // Act tool.parse("-l ${loginIdentityProvidersPath} -i ${loginIdentityProvidersPath}".split(" ") as String[]) - logger.info("Parsed login-identity-providers.xml location: ${tool.loginIdentityProvidersPath}") - logger.info("Parsed output login-identity-providers.xml location: ${tool.outputLoginIdentityProvidersPath}") - - // Assert - assert !TestAppender.events.isEmpty() - assert TestAppender.events.any { - it.message =~ "The source login-identity-providers.xml and destination login-identity-providers.xml are identical \\[.*\\] so the original will be overwritten" - } } @Test @@ -376,14 +357,6 @@ class ConfigEncryptionToolTest extends GroovyTestCase { // Act tool.parse("-a ${authorizersPath} -u ${authorizersPath}".split(" ") as String[]) - logger.info("Parsed authorizers.xml location: ${tool.authorizersPath}") - logger.info("Parsed output authorizers.xml location: ${tool.outputAuthorizersPath}") - - // Assert - assert !TestAppender.events.isEmpty() - assert TestAppender.events.any { - it.message =~ "The source authorizers.xml and destination authorizers.xml are identical \\[.*\\] so the original will be overwritten" - } } @Test @@ -600,19 +573,11 @@ class ConfigEncryptionToolTest extends GroovyTestCase { // Act tool.parse(args) - logger.info("Using password flag: ${tool.usingPassword}") - logger.info("Password: ${tool.password}") - logger.info("Key hex: ${tool.keyHex}") // Assert assert !tool.usingPassword assert !tool.password assert tool.keyHex == KEY_HEX - - assert !TestAppender.events.isEmpty() - assert TestAppender.events.collect { - it.message - }.contains("If the key or password is provided in the arguments, '-r'/'--useRawKey' is ignored") } @Test @@ -623,19 +588,11 @@ class ConfigEncryptionToolTest extends GroovyTestCase { // Act tool.parse(args) - logger.info("Using password flag: ${tool.usingPassword}") - logger.info("Password: ${tool.password}") - logger.info("Key hex: ${tool.keyHex}") // Assert assert tool.usingPassword assert tool.password == PASSWORD assert !tool.keyHex - - assert !TestAppender.events.isEmpty() - assert TestAppender.events.collect { - it.message - }.contains("If the key or password is provided in the arguments, '-r'/'--useRawKey' is ignored") } @Test @@ -1201,13 +1158,6 @@ class ConfigEncryptionToolTest extends GroovyTestCase { assert originalLines == updatedLines } - logger.info("Updated nifi.properties:") - logger.info("\n" * 2 + updatedLines.join("\n")) - - assert TestAppender.events.collect { - it.message - }.contains("The source nifi.properties and destination nifi.properties are identical [${workingFile.path}] so the original will be overwritten".toString()) - workingFile.deleteOnExit() } @@ -2179,9 +2129,6 @@ class ConfigEncryptionToolTest extends GroovyTestCase { // Assert assert serializedLines == encryptedLines - assert TestAppender.events.any { - it.renderedMessage =~ "No provider element with class org.apache.nifi.ldap.LdapProvider found in XML content; the file could be empty or the element may be missing or commented out" - } } @Test @@ -2248,9 +2195,6 @@ class ConfigEncryptionToolTest extends GroovyTestCase { // Assert assert serializedLines.findAll { it }.isEmpty() - assert TestAppender.events.any { - it.renderedMessage =~ "No provider element with class org.apache.nifi.ldap.LdapProvider found in XML content; the file could be empty or the element may be missing or commented out" - } } @Test @@ -2948,10 +2892,6 @@ class ConfigEncryptionToolTest extends GroovyTestCase { // Assert assert serializedLines == encryptedLines - assert TestAppender.events.any { - it.renderedMessage =~ "No provider element with class org.apache.nifi.ldap.tenants.LdapUserGroupProvider found in XML content; " + - "the file could be empty or the element may be missing or commented out" - } } @Test @@ -2980,10 +2920,6 @@ class ConfigEncryptionToolTest extends GroovyTestCase { // Assert assert serializedLines.findAll { it }.isEmpty() - assert TestAppender.events.any { - it.renderedMessage =~ "No provider element with class org.apache.nifi.ldap.tenants.LdapUserGroupProvider found in XML content; " + - "the file could be empty or the element may be missing or commented out" - } } @Test @@ -3491,15 +3427,6 @@ class ConfigEncryptionToolTest extends GroovyTestCase { // Act tool.parse("-n ${niFiPropertiesPath} -f ${flowXmlPath}".split(" ") as String[]) - logger.info("Parsed nifi.properties location: ${tool.niFiPropertiesPath}") - logger.info("Parsed flow.xml.gz location: ${tool.flowXmlPath}") - logger.info("Parsed output flow.xml.gz location: ${tool.outputFlowXmlPath}") - - // Assert - assert !TestAppender.events.isEmpty() - assert TestAppender.events.any { - it.message =~ "The source flow.xml.gz and destination flow.xml.gz are identical \\[.*\\] so the original will be overwritten" - } } @Test @@ -4867,29 +4794,3 @@ class ConfigEncryptionToolTest extends GroovyTestCase { // TODO: Test with 128/256-bit available } - -class TestAppender extends AppenderSkeleton { - static final List<LoggingEvent> events = new ArrayList<>() - - @Override - protected void append(LoggingEvent e) { - synchronized (events) { - events.add(e) - } - } - - static void reset() { - synchronized (events) { - events.clear() - } - } - - @Override - void close() { - } - - @Override - boolean requiresLayout() { - return false - } -} \ No newline at end of file diff --git a/nifi-toolkit/nifi-toolkit-encrypt-config/src/test/resources/log4j.properties b/nifi-toolkit/nifi-toolkit-encrypt-config/src/test/resources/log4j.properties deleted file mode 100644 index 69e4f09..0000000 --- a/nifi-toolkit/nifi-toolkit-encrypt-config/src/test/resources/log4j.properties +++ /dev/null @@ -1,27 +0,0 @@ -# -# 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. -# - -log4j.rootLogger=INFO,console,test - -log4j.appender.console=org.apache.log4j.ConsoleAppender -log4j.appender.console.Target=System.err -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n - -log4j.appender.test=org.apache.nifi.properties.TestAppender -log4j.appender.test.layout=org.apache.log4j.PatternLayout -log4j.appender.test.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n \ No newline at end of file diff --git a/nifi-toolkit/nifi-toolkit-tls/src/test/resources/log4j.properties b/nifi-toolkit/nifi-toolkit-tls/src/test/resources/log4j.properties deleted file mode 100644 index fc2aaf1..0000000 --- a/nifi-toolkit/nifi-toolkit-tls/src/test/resources/log4j.properties +++ /dev/null @@ -1,22 +0,0 @@ -# -# 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. -# - -log4j.rootLogger=INFO,console - -log4j.appender.console=org.apache.log4j.ConsoleAppender -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n \ No newline at end of file diff --git a/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/test/resources/log4j.properties b/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/test/resources/log4j.properties deleted file mode 100644 index 6072b3e..0000000 --- a/nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/test/resources/log4j.properties +++ /dev/null @@ -1,24 +0,0 @@ -# -# 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. -# - -log4j.rootLogger=INFO,console - -log4j.logger.org.apache.zookeeper=WARN,console - -log4j.appender.console=org.apache.log4j.ConsoleAppender -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss} %p [%t] %c: %m%n \ No newline at end of file diff --git a/nifi-toolkit/pom.xml b/nifi-toolkit/pom.xml index 9ea80d3..651fc71 100644 --- a/nifi-toolkit/pom.xml +++ b/nifi-toolkit/pom.xml @@ -63,7 +63,7 @@ <dependencies> <dependency> <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> + <artifactId>slf4j-simple</artifactId> </dependency> </dependencies> <profiles> diff --git a/pom.xml b/pom.xml index 9735288..54ebe3c 100644 --- a/pom.xml +++ b/pom.xml @@ -770,6 +770,8 @@ <exclude>c3p0:c3p0:*:*:compile</exclude> <!-- Versions of JSR305 before 3.0.1 are not allowed https://github.com/findbugsproject/findbugs/issues/128 --> <exclude>com.google.code.findbugs:jsr305:*:*:compile</exclude> + <!-- Log4J excluded in favor of log4j-over-slf4j and logback --> + <exclude>log4j:log4j:*</exclude> </excludes> <includes> <!-- Versions of JSR305 after 3.0.1 are allowed https://github.com/findbugsproject/findbugs/issues/128 -->