title: Log file is created but File is empty
body: <p>I am using log4j.properties file for generating logs in my java project. I want only custom log statements and log file corresponding to that statements.
  My log file is like this:</p>
  
  <pre><code>log4j.logger.org.apache.axis.enterprise=DEBUG, stdout,Rollfile
  log4j.rootLogger=off
  log4j.logger.com.gridsense.server.automode=Rollfile,stdout
  log4j.appender.Rollfile=org.apache.log4j.RollingFileAppender
  log4j.appender.Rollfile.Threshold=DEBUG
  log4j.appender.Rollfile.File=D:/javaProjects/AutomodeGS_Prachi/AutoGS.log
  log4j.appender.Rollfile.MaxFileSize=2MB
  log4j.appender.Rollfile.layout=org.apache.log4j.PatternLayout
  log4j.appender.Rollfile.layout.ConversionPattern=[%t] %-5p %c %d{dd/MM/yyyy HH:mm:ss}  – %m%n
  
  log4j.appender.stdout=org.apache.log4j.ConsoleAppender
  log4j.appender.stdout.Threshold=DEBUG
  log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  log4j.appender.stdout.layout.ConversionPattern=%-4r [%t] %-5p %c %x – %m%n
  </code></pre>
  
  <p>But when i run the program the log statements are printed on console and empty log file is created. I don't understand what is problem.Why my log file is empty?
  In my class i have written the statement </p>
  
  <pre><code>private static  Logger logger = Logger.getLogger(Driver.class);
  </code></pre>
  
  <p>I am importing </p>
  
  <pre><code>import org.apache.log4j.Logger;
  </code></pre>
  
  <p>Actually I read your solution given to a question related to "Log4J file Empty" and made some changes in my code. I changed the import statement to</p>
  
  <pre><code>import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  </code></pre>
  
  <p>and in my class :</p>
  
  <pre><code>static Log   logger = LogFactory.getLog(Driver.class);
  </code></pre>
  
  <p>Still i encounter the same problem. Any suggestion will be helpful.</p>