title: Log4j FileAppender creates empty file
body: <p>I have problem using log4j with file logging. I can't get it to work even after searching the web for a quite long time now.</p>
  
  <p>my log4j.properties file: </p>
  
  <pre><code>  log4j.rootLogger = DEBUG, FILE
    log4j.appender.FILE=org.apache.log4j.FileAppender
    log4j.appender.FILE.File=log.out
    log4j.appender.FILE.ImmediateFlush=true
    log4j.appender.FILE.Append=true
    log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
    log4j.appender.FILE.layout.conversionPattern=%m%n
  </code></pre>
  
  <p>my java producer class: </p>
  
  <pre><code>@Singleton
  public class Loggers {
  
     @Produces
     public Logger getLogger(InjectionPoint ip) throws IOException {
      Member member = ip.getMember();
      Class&lt;?&gt; declaredInClass=member.getDeclaringClass();
      Logger logger=Logger.getLogger(declaredInClass.getSimpleName());
      Properties props = new Properties();
      props.load(Loggers.class.getClassLoader().getResourceAsStream(("log4j.properties")));
      PropertyConfigurator.configure(props);
      logger.info("should be in the file but it is only in console");
      return logger;
     }
  }
  </code></pre>
  
  <p>What are the possibilities that it just creates empty file and doesn't log there? However, it logs to the console.</p>