datastax / cassandra-quarkus

An Apache Cassandra(R) extension for Quarkus
Apache License 2.0
40 stars 28 forks source link

Clarify usage of log frameworks #70

Closed adutra closed 4 years ago

adutra commented 4 years ago

Right now we claim to use SLF4J only. It is indeed our logging API but:

  1. We don't declare it in any pom, so it gets pulled transitively from the driver. We need to explicitly declare this dependency where appropriate.
  2. In some places, we are using the JBoss logging backed directly, e.g. in CassandraTestResource. We should change that. It might also be a good thing, for correctness, to also declare a runtime dependency on that backend.

Originally posted by adutra in https://github.com/datastax/cassandra-quarkus/pull/67/files

┆Issue is synchronized with this Jira Task by Unito

adutra commented 4 years ago

We also added recently this dependency to the quickstart:

<dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>commons-logging-jboss-logging</artifactId>
      <scope>runtime</scope>
    </dependency>
tomekl007 commented 4 years ago

It seems that we cannot use Log4J because it is banned dependency in the quarkus, see:

<!-- Ban Log4J (use org.jboss.logmanager:log4j-jboss-logmanager instead) -->
<exclude>log4j:log4j</exclude>
<exclude>org.apache.logging.log4j:log4j-api</exclude>
<exclude>org.apache.logging.log4j:log4j-core</exclude>
<exclude>org.apache.logging.log4j:log4j-slf4j-impl</exclude>

Instead of this, the logger should be defined like this:

import org.jboss.logging.Logger;

private static final Logger LOGGER = Logger.getLogger(GrpcClientProcessor.class.getName());
tomekl007 commented 4 years ago

We are allowed to use log4j so this issue can be closed