Question : Use slf4j with properties file


I'm trying to log with slf4j using properties file. But I am not sure how to load the properties file. Here is the code I'm using:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestLog4j {
  public static void main(String[] args) {
    Logger logger = LoggerFactory.getLogger(TestLog4j.class);
    // This works only for log4j, but not slf4j
    //PropertyConfigurator.configure("");"Hello World");  
  private TestLog4j() {

My file looks like this:


log4j.logger.TestLog4j=INFO, A1

Thanks a lot!

Answer : Use slf4j with properties file

You should have to load it at all explicitly. Just make sure it's in the classpath
Random Solutions  
programming4us programming4us