Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"No SLF4J providers were found" after adding slf4j-api-2.0.0-alpha1.jar to the project structure and the slf4j dependency to the pom.xml

I am trying to use Apache Beam with Java using IntelliJ and I get the

"SLF4J: No SLF4J providers were found. SLF4J: Defaulting to no-operation (NOP) logger implementation" error

when I have already added the slf4j-api-2.0.0-alpha1.jar to the project structure and the slf4j dependency to the pom.xml

Here are some screenshots for more context:

enter image description here

enter image description here

enter image description here

like image 717
Jerome Pullen Jr. Avatar asked Oct 23 '25 19:10

Jerome Pullen Jr.


2 Answers

First of all, the SLF4J messages are only warnings and can be ignored. They most probably have nothing to do with Exception in thread "main".

They mean that some code is trying to use slf4j api, but no implementation handles what to do with these logs. You may get rid of the warnings by adding to your classpath a working implementation of the SLF4j, e.g. org.slf4j:slf4j-simple to make the logs show in the console or org.slf4j:slf4j-nop to ignore any logging explicitly or one of a number of other logging framework integration options.

like image 147
JockX Avatar answered Oct 26 '25 09:10

JockX


You have added slf4j-api module, which is the API for adding logging statements to your code. It does not actually do anything with the logs, so they will be dropped. You will need to choose a backend such as slf4j-jdk14 or slf4j-logback13.

The exception in your screenshot is not related.

like image 40
Kenn Knowles Avatar answered Oct 26 '25 10:10

Kenn Knowles