Log4j err Failed to load class "org.slf4j.impl.StaticLoggerBinder"

Hi

How could i log4j and stop this error ? regards
[2022-04-24T08:33:38,406][INFO ][o.o.n.Node ] [82bb2d012552] JVM arguments [-Xshare:auto, -Dopensearch.networkaddress.cache.ttl=60, -Dopensearch.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=SPI,COMPAT, -Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.io.tmpdir=/tmp/opensearch-9271624953824617923, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -XX:MaxDirectMemorySize=536870912, -Dopensearch.path.home=/opt/opensearch/opensearch-1.3.1, -Dopensearch.path.conf=/opt/opensearch/opensearch-1.3.1/config, -Dopensearch.distribution.type=tar, -Dopensearch.bundled_jdk=true]
[2022-04-24T08:33:40,008][WARN ][stderr ] [82bb2d012552] SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
[2022-04-24T08:33:40,009][WARN ][stderr ] [82bb2d012552] SLF4J: Defaulting to no-operation (NOP) logger implementation

1 Like

I am seeing the same error which seems to prevent things like the security plugin from logging.

It seems like the tarball is missing slf4j-simple.jar or similar - see SLF4J Error Codes

This appears to have been fixed in the 1.3.X RPMs, but now is back with the 2.0.0 RPM.

Hi guys.
The warning message I can see in OpenSearch v2.5.0, but I am not able to find any solution to solve it.
I would like to ask you for solution. Exist? Or just ignore the warning?
Thank you!

It seems to be caused by plugins, not OpenSearch core:

./plugins/opensearch-ml/slf4j-api-1.7.36.jar
./plugins/opensearch-security/slf4j-api-1.7.30.jar
./plugins/opensearch-alerting/slf4j-api-1.7.30.jar
./plugins/opensearch-sql/slf4j-api-1.7.36.jar
./plugins/opensearch-sql/slf4j-reload4j-1.7.36.jar

Relevant issue: [BUG] SLF4J: Failed to load class `"org.slf4j.impl.StaticLoggerBinder"` · Issue #6663 · opensearch-project/OpenSearch · GitHub

It still is an issue in 2.6.0