Skip to content

Commit bb235e2

Browse files
committed
HBASE-30060: Add documentation about addressing multiple SLF4J bindings
Change-Id: Iac030961d93b659baf14c0b94cc57928e7e0c883
1 parent 39c7455 commit bb235e2

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

hbase-website/app/pages/_docs/docs/_mdx/(multi-page)/troubleshooting.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,26 @@ To disable, set the logging level back to `INFO` level.
5555

5656
The same log settings also work on Master and for the client.
5757

58+
## Handling Multiple SLF4J Bindings to Prevent Overridden Log Configurations
59+
60+
If you have a local installation of Hadoop (e.g., installed via Homebrew on macOS), you may encounter a "multiple SLF4J bindings" warning when running `bin/start-hbase.sh`. For example, you may see the following when starting HBase on your machine:
61+
62+
```
63+
SLF4J: Class path contains multiple SLF4J bindings.
64+
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]
65+
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]
66+
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
67+
SLF4J: Actual binding is of type [org.slf4j.impl.Reload4jLoggerFactory]
68+
```
69+
70+
This is happening because the `bin/hbase` script automatically detects local Hadoop installations and adds their classpath to HBase. If your Hadoop installation uses the legacy Reload4j (or Log4j 1.2) binder, SLF4J may prioritize it over the HBase Log4j2 binder. When this happens, your `conf/log4j2.properties` file and `HBASE_ROOT_LOGGER` environment variable are completely ignored.
71+
72+
To get around this issue, you can set `HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP` to `true`. You can modify this directly in `conf/hbase-env.sh` by uncommenting the following line:
73+
74+
```bash
75+
export HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP="true"
76+
```
77+
5878
## JVM Garbage Collection Logs
5979

6080
<Callout type="info">

0 commit comments

Comments
 (0)