Stop slf4j messages from printing in java
<p>I have the below code and donot want these log messages to be printed.I also want to stop log messages from other libraries in the same project to be printed.</p>

<pre><code>import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Main{


public static void main(String[] args) {
    final Logger slf4jLogger = LoggerFactory.getLogger(Main.class);
    slf4jLogger.info("im printing info");
    slf4jLogger.error("printing error");
}
</code></pre>

<p>I have log4j.properties under src/test/resources also added in classpath.
log4j.properties is as follows</p>

<pre><code>log4j.rootLogger=OFF
log4j.logger.main=OFF
</code></pre>

<p>I want to stop these logs from printing to console.
But its not working and printing the logs.
Is it something which i am missing?</p>