datastax / cassandra-quarkus

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

issue70 - Clarify usage of log frameworks #77

Closed tomekl007 closed 4 years ago

adutra commented 4 years ago

I'm sorry but I think I'm changing my mind here. The more I analyze how logging is supposed to work the more I think we should stick with SLF4J because:

  1. It's what the driver uses anyways.
  2. Using JBoss Logging is only a requirement if you inherit from Quarkus parent pom, which is not our case. When inheriting from Quarkus parent, it makes sense to exclude SLF4J since other logging frameworks (JBoss) are already present. But in our case no logging framework is present by default, so we really can choose whichever we want IMO.
  3. Regarding JCL bridge over SLF4J, it also makes sense to exclude it when inheriting from Quarkus parent: an equivalent bridge is already present. But in our case it shouldn't be removed because no other bridge is present by default.
adutra commented 4 years ago

Also to note: quarkus-core has a dependency on slf4j-api, so I guess that's what they want extensions to use primarily. See also https://github.com/quarkusio/quarkus/issues/294#issuecomment-447591945.

tomekl007 commented 4 years ago

Also to note: quarkus-core has a dependency on slf4j-api, so I guess that's what they want extensions to use primarily. See also quarkusio/quarkus#294 (comment).

I am bit confused because, on the other hand, all extensions in the quarkus repo are using JBoss

adutra commented 4 years ago

I am bit confused because, on the other hand, all extensions in the quarkus repo are using JBoss

From what I see if your extension is in quarkus repo, you have 2 choices:

  1. use sl4j-api as frontend and org.jboss.slf4j:slf4j-jboss-logging as backend (slf4j-api is not banned)
  2. use jboss-logging as your frontend and backend.

I guess that out of habitude, everybody went for option 2.

Also, apparently option 1 gets substituted at runtime with option 2. see https://github.com/quarkusio/quarkus/blob/987a4db26d31057ea562d287d9b1d4566bc4a176/core/runtime/src/main/java/io/quarkus/runtime/graal/LoggingSubstitutions.java.

tomekl007 commented 4 years ago

Also, apparently option 1 gets substituted at runtime with option 2. see https://github.com/quarkusio/quarkus/blob/987a4db26d31057ea562d287d9b1d4566bc4a176/core/runtime/src/main/java/io/quarkus/runtime/graal/LoggingSubstitutions.java.

yes, I saw that substitution - so it seems that using JBoss is more "friendly" for native graal mode; it does not involve a substitution code

adutra commented 4 years ago

@tomekl007 I think this is obsolete now, we verified that using SLF4J is 100% supported. OK to close?

tomekl007 commented 4 years ago

@tomekl007 I think this is obsolete now, we verified that using SLF4J is 100% supported. OK to close?

yes - closed