Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slf4j configuration is broken due to shade relocation #16

Closed
ooasis opened this issue Apr 27, 2018 · 3 comments · Fixed by #20
Closed

slf4j configuration is broken due to shade relocation #16

ooasis opened this issue Apr 27, 2018 · 3 comments · Fixed by #20

Comments

@ooasis
Copy link
Contributor

ooasis commented Apr 27, 2018

It seems slf4j is broken due to shade relocation process.

Trying to use logback with slf4j and always get following error:

    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.

Looking into the cause, it is due to shade relocation process changed this line:

net.snowflake.client.jdbc.internal.org.slf4j.LoggerFactory

L47:   private static String STATIC_LOGGER_BINDER_PATH = 
  "net/snowflake/client/jdbc/internal/org/slf4j/impl/StaticLoggerBinder.class";

This should be "org/slf4j/impl/StaticLoggerBinder.class" to match the slf4j's init process.

@ooasis
Copy link
Contributor Author

ooasis commented Apr 27, 2018

Submitted a PR #17

@howryu
Copy link
Contributor

howryu commented Apr 27, 2018

Thanks for your reporting and contribution. I need to discuss with the team whether we should go this way or not.

@ooasis
Copy link
Contributor Author

ooasis commented Apr 27, 2018

If a library is only used internally for your implementation, it is ok to relocate it to avoid version conflicts. For the case of logging, usually people would like to have an unified configuration cross entire application (this is one of the reason to use SLF4J), so it is better to give application developer more control. SLF4J has been around long enough, so I would not expect to have big issue with version conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants