title: How do I read .properties file using slf4j?
body: <p>I am trying to make a simple program which reads the properties file and logs the output to console but I am not able to do that.</p>
  
  <p>This is my class:</p>
  
  <pre><code>import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
  public final class Slf4jSample {
  
      public static void main(final String[] args) {
          final Logger logger = LoggerFactory.getLogger(Slf4jSample.class);
  
          logger.info("Hello World!");
      }
  
      private Slf4jSample() {
      }
  }
  </code></pre>
  
  <p>And this is my properties file:</p>
  
  <pre><code>log4j.appender.A1=org.apache.log4j.ConsoleAppender
  log4j.appender.A1.layout=org.apache.log4j.PatternLayout
  
  log4j.logger.Slf4jSample=INFO, A1
  </code></pre>
  
  <p>When I run this it gives this exception:</p>
  
  <pre><code>log4j:WARN No appenders could be found for logger (com.slf4j.Slf4jSample).
  log4j:WARN Please initialize the log4j system properly.
  log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
  </code></pre>