I am new to slf4j, In my Project I am using it for getting Logs.
I am using InteliJ IDE.
Here is my code
package com.sample;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TestMainclass
{
static Logger logger = LoggerFactory.getLogger(TestMainclass.class);
public static void main(String[] args) {
System.out.println("before");
logger.debug("hello");
logger.info("hello");
System.out.println("after");
}
}
here is the dependency
testCompile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.30'
Everything working fine in normal setup but when I build my code, and run that jar with junit-platform-console-standalone-1.5.2.jar , below error is coming:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.