Hi everyone. I’ve been searching the channel and s...
# troubleshoot
g
Hi everyone. I’ve been searching the channel and saw some mention of the SLF4J issue
Copy code
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See <http://www.slf4j.org/codes.html#StaticLoggerBinder> for further details.
and that it was fixed. Well, not in Java datahub-client. I am using the latest and greatest
Copy code
implementation 'io.acryl:datahub-client:0.9.6-3'
and yet (trivial Boot app from start.spring.io)
Copy code
$ ./gradlew bootRun

> Task :bootRun

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.0.2)

2023-02-02T16:11:01.813-08:00  INFO 58440 --- [           main] c.e.demo.DemoLoggingIssueApplication     : Starting DemoLoggingIssueApplication using Java 17.0.1 with PID 58440 (/private/tmp/demo-logging-issue/build/classes/java/main started by raysuliteanu in /private/tmp/demo-logging-issue)
2023-02-02T16:11:01.815-08:00  INFO 58440 --- [           main] c.e.demo.DemoLoggingIssueApplication     : No active profile set, falling back to 1 default profile: "default"
2023-02-02T16:11:02.110-08:00  INFO 58440 --- [           main] c.e.demo.DemoLoggingIssueApplication     : let's create a DataHub RestEmitter!
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See <http://www.slf4j.org/codes.html#StaticLoggerBinder> for further details.
2023-02-02T16:11:02.436-08:00  INFO 58440 --- [           main] c.e.demo.DemoLoggingIssueApplication     : Started DemoLoggingIssueApplication in 0.877 seconds (process running for 1.126)
2023-02-02T16:11:02.437-08:00  INFO 58440 --- [           main] c.e.demo.DemoLoggingIssueApplication     : that was fun

BUILD SUCCESSFUL in 2s
4 actionable tasks: 4 executed
I have attached the example project; just unzip and run gradlew. Needless to say, without creating a
RestEmitter
, there is no SLF4J error. Suggestions?
@brainy-tent-14503 I noticed this PR https://github.com/datahub-project/datahub/pull/6616 which I thought was related to the above issue with SLF4J but obviously doesn’t resolve it for datahub-client. Any thoughts?
b
The goal is to not enforce a specific logging implementation on your application. You’ll need to add your preferred logging implementation or log redirector that you’d like use, whether that is logback or something that might already be used in the project.
g
So we do have logging defined; we use logback (from Spring Boot). As you can see from the output, the logging works, but we get that error and I don’t like to see errors like that 😛 I think the problem is related to the fact that datahub-client.jar is a fat jar. Not sure but that’s my suspicion. Why is it a fat jar? There are classes included that have nothing to do with the Java client. I’d guess 80-90% of what’s in the jar isn’t needed for the Java client. The jar is 35M
b
Gotcha, that makes sense. Yeah, it is a fat jar since it is used in spark jobs and makes it easier to use in that context. Likely extra classes but some effort is made to trim down the requirements.
g
Could you perhaps make 2 versions of the jar e.g. datahub-client.jar and datahub-client-spark.jar or some such? Keep the Java-only one thin
and maybe create a BOM with the required dependencies (that are currently in the fat jar) that can be imported to maven/gradle
maybe I’ll ask this on #feature-requests
b
Makes sense to me, happy to accept a PR, however we probably would want to keep the default jar as the fat version to prevent impacting existing use cases.
g
yeah I thought of that too and put that in the feature request https://datahubspace.slack.com/archives/C02FWNS2F08/p1675874444315459