Skip to content

Commit 8122404

Browse files
authored
deps: migrate to logback-classic (port of #3425) (#3426)
1 parent d78fc91 commit 8122404

File tree

4 files changed

+62
-22
lines changed

4 files changed

+62
-22
lines changed

bigtable-hbase-1.x-parent/bigtable-hbase-1.x-tools/pom.xml

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,37 @@
4747
<groupId>org.apache.hbase</groupId>
4848
<artifactId>hbase-shaded-client</artifactId>
4949
<version>${hbase.version.1}</version>
50+
<exclusions>
51+
<exclusion>
52+
<groupId>log4j</groupId>
53+
<artifactId>log4j</artifactId>
54+
</exclusion>
55+
<exclusion>
56+
<groupId>org.slf4j</groupId>
57+
<artifactId>slf4j-log4j12</artifactId>
58+
</exclusion>
59+
</exclusions>
5060
</dependency>
5161
<dependency>
5262
<groupId>com.google.guava</groupId>
5363
<artifactId>guava</artifactId>
5464
<version>30.1.1-android</version>
5565
</dependency>
5666
<dependency>
57-
<groupId>org.apache.logging.log4j</groupId>
58-
<artifactId>log4j-api</artifactId>
59-
<version>${log4j2.version}</version>
67+
<groupId>org.slf4j</groupId>
68+
<artifactId>slf4j-api</artifactId>
69+
<version>1.7.32</version>
70+
</dependency>
71+
<dependency>
72+
<groupId>org.slf4j</groupId>
73+
<artifactId>log4j-over-slf4j</artifactId>
74+
<version>1.7.32</version>
75+
<scope>runtime</scope>
6076
</dependency>
6177
<dependency>
62-
<groupId>org.apache.logging.log4j</groupId>
63-
<artifactId>log4j-core</artifactId>
64-
<version>${log4j2.version}</version>
78+
<groupId>ch.qos.logback</groupId>
79+
<artifactId>logback-classic</artifactId>
80+
<version>1.2.10</version>
6581
<scope>runtime</scope>
6682
</dependency>
6783
<dependency>
@@ -134,6 +150,28 @@
134150
<target>${compileSource.1.8}</target>
135151
</configuration>
136152
</plugin>
153+
<plugin>
154+
<groupId>org.apache.maven.plugins</groupId>
155+
<artifactId>maven-enforcer-plugin</artifactId>
156+
<executions>
157+
<execution>
158+
<id>enforce-banned-deps</id>
159+
<goals>
160+
<goal>enforce</goal>
161+
</goals>
162+
<configuration>
163+
<rules>
164+
<bannedDependencies>
165+
<excludes>
166+
<exclude>org.apache.logging.log4j:*:*</exclude>
167+
<exclude>log4j:log4j:*</exclude>
168+
</excludes>
169+
</bannedDependencies>
170+
</rules>
171+
</configuration>
172+
</execution>
173+
</executions>
174+
</plugin>
137175
</plugins>
138176
</build>
139177

bigtable-hbase-1.x-parent/bigtable-hbase-1.x-tools/src/main/java/com/google/cloud/bigtable/hbase/tools/HBaseSchemaTranslator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
import org.apache.hadoop.hbase.client.Connection;
4848
import org.apache.hadoop.hbase.client.ConnectionFactory;
4949
import org.apache.hadoop.hbase.exceptions.DeserializationException;
50-
import org.apache.logging.log4j.LogManager;
51-
import org.apache.logging.log4j.Logger;
50+
import org.slf4j.Logger;
51+
import org.slf4j.LoggerFactory;
5252

5353
/**
5454
* A utility to create tables in Cloud Bigtable based on the tables in an HBase cluster.
@@ -101,7 +101,7 @@ public class HBaseSchemaTranslator {
101101
public static final String TABLE_NAME_FILTER_KEY = "google.bigtable.table.filter";
102102
public static final String SCHEMA_MAPPING_FILEPATH = "google.bigtable.schema.mapping.filepath";
103103

104-
private static final Logger LOG = LogManager.getLogger(HBaseSchemaTranslator.class);
104+
private static final Logger LOG = LoggerFactory.getLogger(HBaseSchemaTranslator.class);
105105

106106
private final SchemaReader schemaReader;
107107
private final SchemaTransformer schemaTransformer;

bigtable-hbase-1.x-parent/bigtable-hbase-1.x-tools/src/main/resources/log4j2.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration>
3+
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
4+
<layout class="ch.qos.logback.classic.PatternLayout">
5+
<Pattern>
6+
%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n
7+
</Pattern>
8+
</layout>
9+
</appender>
10+
<!-- Uncomment the following line to get detailed logs on Schema Translator-->
11+
<!-- <logger name="com.google.cloud.bigtable.hbase.tools.HBaseSchemaTranslator" level="TRACE"/>-->
12+
<root level="INFO">
13+
<appender-ref ref="stdout"/>
14+
</root>
15+
</configuration>

0 commit comments

Comments
 (0)