HBASE-30060: Add documentation about addressing multiple SLF4J bindings#8029
Conversation
There was a problem hiding this comment.
Pull request overview
Adds troubleshooting documentation for resolving “Class path contains multiple SLF4J bindings” warnings when starting HBase in environments where a local Hadoop installation contributes conflicting SLF4J binders.
Changes:
- Document the cause and impact of multiple SLF4J bindings overriding HBase’s Log4j2 configuration.
- Provide a workaround via
HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP=trueinconf/hbase-env.sh. - Include an example of the SLF4J multiple-bindings warning output.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ``` | ||
| SLF4J: Class path contains multiple SLF4J bindings. | ||
| SLF4J: Found binding in [jar:file:/opt/homebrew/Cellar/hadoop/3.4.1/libexec/share/hadoop/common/lib/slf4j-reload4j-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class] | ||
| SLF4J: Found binding in [jar:file:/Users/kgeiszler/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.25.3/log4j-slf4j-impl-2.25.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] | ||
| SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. | ||
| SLF4J: Actual binding is of type [org.slf4j.impl.Reload4jLoggerFactory] | ||
| ``` |
There was a problem hiding this comment.
The SLF4J warning snippet is console output; elsewhere in this doc similar output blocks use an explicit language (e.g., text). Consider changing this fence to text for consistent rendering/syntax highlighting.
| ``` | ||
| SLF4J: Class path contains multiple SLF4J bindings. | ||
| SLF4J: Found binding in [jar:file:/opt/homebrew/Cellar/hadoop/3.4.1/libexec/share/hadoop/common/lib/slf4j-reload4j-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class] | ||
| SLF4J: Found binding in [jar:file:/Users/kgeiszler/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.25.3/log4j-slf4j-impl-2.25.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] |
There was a problem hiding this comment.
This example output includes a specific contributor username/path (/Users/kgeiszler/...). To avoid embedding personal identifiers and to make the example more broadly applicable, consider replacing it with a placeholder like $HOME/.m2/... (and optionally eliding version numbers).
| SLF4J: Found binding in [jar:file:/Users/kgeiszler/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.25.3/log4j-slf4j-impl-2.25.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] | |
| SLF4J: Found binding in [jar:file:$HOME/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.25.3/log4j-slf4j-impl-2.25.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] |
hbase-website/app/pages/_docs/docs/_mdx/(multi-page)/troubleshooting.mdx
Show resolved
Hide resolved
hbase-website/app/pages/_docs/docs/_mdx/(multi-page)/troubleshooting.mdx
Outdated
Show resolved
Hide resolved
hbase-website/app/pages/_docs/docs/_mdx/(multi-page)/troubleshooting.mdx
Show resolved
Hide resolved
Change-Id: Iac030961d93b659baf14c0b94cc57928e7e0c883
bb235e2 to
32a6168
Compare
https://issues.apache.org/jira/browse/HBASE-30060
This pull request adds some documentation for how to get around the
Class path contains multiple SLF4J bindingswarning you may see after starting HBase when you also have a local installation of Hadoop. Knowing what to do is important because Hadoop's SLF4J binder may end up getting used instead of HBase's. If this happens, then any log settings you have for HBase get overridden. For example, if you want to activate DEBUG logging for HBase, then you won't see that happen due to Hadoop's binding being used.