Skip to content

Commit 10ee6f0

Browse files
leonardBangyexianxun
authored andcommitted
[build] Switch to Log4j 2 by default (apache#791)
1 parent 88a4022 commit 10ee6f0

File tree

5 files changed

+34
-40
lines changed

5 files changed

+34
-40
lines changed

flink-connector-mongodb-cdc/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,6 @@ under the License.
143143
<scope>test</scope>
144144
</dependency>
145145

146-
<!-- tests will have log4j as the default logging framework available -->
147-
148-
<!-- Logging API -->
149-
<dependency>
150-
<groupId>org.apache.logging.log4j</groupId>
151-
<artifactId>log4j-slf4j-impl</artifactId>
152-
<version>${log4j.version}</version>
153-
<scope>test</scope>
154-
</dependency>
155-
156146
</dependencies>
157147

158148
</project>

flink-connector-mysql-cdc/pom.xml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,6 @@ under the License.
183183
<scope>test</scope>
184184
</dependency>
185185

186-
<!-- tests will have log4j as the default logging framework available -->
187-
188-
<dependency>
189-
<groupId>org.apache.logging.log4j</groupId>
190-
<artifactId>log4j-slf4j-impl</artifactId>
191-
<version>${log4j.version}</version>
192-
<scope>test</scope>
193-
</dependency>
194-
195186
</dependencies>
196187

197-
</project>
188+
</project>

flink-connector-oracle-cdc/pom.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,6 @@ under the License.
143143
<scope>test</scope>
144144
</dependency>
145145

146-
<!-- tests will have log4j as the default logging framework available -->
147-
148-
<dependency>
149-
<groupId>org.apache.logging.log4j</groupId>
150-
<artifactId>log4j-slf4j-impl</artifactId>
151-
<version>${log4j.version}</version>
152-
<scope>test</scope>
153-
</dependency>
154-
155146
</dependencies>
156147

157148
</project>

flink-connector-postgres-cdc/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,6 @@ under the License.
150150
<scope>test</scope>
151151
</dependency>
152152

153-
<dependency>
154-
<groupId>org.apache.logging.log4j</groupId>
155-
<artifactId>log4j-slf4j-impl</artifactId>
156-
<version>${log4j.version}</version>
157-
<scope>test</scope>
158-
</dependency>
159-
160153
</dependencies>
161154

162155
</project>

pom.xml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,11 @@ under the License.
8282
<maven.compiler.target>${java.version}</maven.compiler.target>
8383
<hamcrest.version>1.3</hamcrest.version>
8484
<slf4j.version>1.7.15</slf4j.version>
85-
<log4j.version>2.16.0</log4j.version>
85+
<log4j.version>2.17.1</log4j.version>
8686
<spotless.version>2.4.2</spotless.version>
8787
<!-- Enforce single fork execution due to heavy mini cluster use in the tests -->
8888
<flink.forkCount>1</flink.forkCount>
8989
<flink.reuseForks>true</flink.reuseForks>
90-
<log4j.configuration>log4j2-test.properties</log4j.configuration>
9190
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
9291
</properties>
9392

@@ -118,16 +117,47 @@ under the License.
118117
<version>${flink.version}</version>
119118
<scope>provided</scope>
120119
</dependency>
120+
<dependency>
121+
<groupId>org.slf4j</groupId>
122+
<artifactId>slf4j-api</artifactId>
123+
<version>${slf4j.version}</version>
124+
</dependency>
121125

122126
<!-- test dependencies -->
123-
124127
<dependency>
125128
<groupId>org.hamcrest</groupId>
126129
<artifactId>hamcrest-all</artifactId>
127130
<version>${hamcrest.version}</version>
128131
<type>jar</type>
129132
<scope>test</scope>
130133
</dependency>
134+
135+
<!-- tests will have log4j as the default logging framework available -->
136+
<dependency>
137+
<groupId>org.apache.logging.log4j</groupId>
138+
<artifactId>log4j-slf4j-impl</artifactId>
139+
<version>${log4j.version}</version>
140+
<scope>test</scope>
141+
</dependency>
142+
<dependency>
143+
<groupId>org.apache.logging.log4j</groupId>
144+
<artifactId>log4j-api</artifactId>
145+
<version>${log4j.version}</version>
146+
<scope>test</scope>
147+
</dependency>
148+
<dependency>
149+
<groupId>org.apache.logging.log4j</groupId>
150+
<artifactId>log4j-core</artifactId>
151+
<version>${log4j.version}</version>
152+
<scope>test</scope>
153+
</dependency>
154+
<dependency>
155+
<!-- API bridge between log4j 1 and 2 -->
156+
<groupId>org.apache.logging.log4j</groupId>
157+
<artifactId>log4j-1.2-api</artifactId>
158+
<version>${log4j.version}</version>
159+
<scope>test</scope>
160+
</dependency>
131161
</dependencies>
132162

133163
<build>
@@ -316,7 +346,6 @@ under the License.
316346
<reuseForks>${flink.reuseForks}</reuseForks>
317347
<systemPropertyVariables>
318348
<forkNumber>0${surefire.forkNumber}</forkNumber>
319-
<log4j.configuration>${log4j.configuration}</log4j.configuration>
320349
</systemPropertyVariables>
321350
<!-- Prevent ORA-01882: timezone region not found errors due to the Oracle DB
322351
does not understanding some time zone which used in Ubuntu OS -->

0 commit comments

Comments
 (0)