Skip to content

Commit

Permalink
deps: migrate to log4j-core (googleapis#3326)
Browse files Browse the repository at this point in the history
  • Loading branch information
kolea2 committed Dec 10, 2021
1 parent 7da8fc2 commit 82d0df9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
12 changes: 12 additions & 0 deletions bigtable-hbase-1.x-parent/bigtable-hbase-1.x-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<properties>
<mainclass>com.google.cloud.bigtable.hbase.tools.HBaseSchemaTranslator</mainclass>
<log4j2.version>2.15.0</log4j2.version>
</properties>
<artifactId>bigtable-hbase-1.x-tools</artifactId>

Expand Down Expand Up @@ -64,6 +65,17 @@
<version>1.2.17</version>
</dependency>
<dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
<scope>runtime</scope>
</dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>${jsr305.version}</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.exceptions.DeserializationException;
import org.apache.log4j.BasicConfigurator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

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

private static final Logger LOG = LoggerFactory.getLogger(HBaseSchemaTranslator.class);
private static final Logger LOG = LogManager.getLogger(HBaseSchemaTranslator.class);

private final SchemaReader schemaReader;
private final SchemaTransformer schemaTransformer;
Expand Down Expand Up @@ -537,9 +536,6 @@ private static void usage(final String errorMsg) {
}

public static void main(String[] args) throws IOException, DeserializationException {
// Configure the logger.
BasicConfigurator.configure();

SchemaTranslationOptions options = SchemaTranslationOptions.loadOptionsFromSystemProperties();
HBaseSchemaTranslator translator = new HBaseSchemaTranslator(options);
translator.translate();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" ?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT"/>
</Appenders>
<Loggers>
<Root level="INFO"/>
<!-- Uncomment the following lines to get detailed logs on Schema Translator-->
<!-- <Logger name="com.google.cloud.bigtable.hbase.tools.HBaseSchemaTranslator" level="TRACE">-->
<!-- <AppenderRef ref="STDOUT"/>-->
<!-- </Logger>-->
</Loggers>
</Configuration>

0 comments on commit 82d0df9

Please sign in to comment.