title: Initializing log4j for a stand alone application
body: <p>I'm a newbie to log4j.  This is what I have . I have about 20 files in different packages in a STAND ALONE JAVA APPLICATION. 
  I am trying to use and write log files. </p>
  
  <p>Following is my <strong>log4j.properties file</strong> which is in my class path:</p>
  
  <pre><code>log4j.appender.R = org.apache.log4j.DailyRollingFileAppender
  log4j.appender.R.File = /ParentFolder/ChildFolder/application.log
  log4j.appender.R.Append = true
  log4j.appender.R.DatePattern = '.'yyy-MM-dd
  log4j.appender.R.layout = org.apache.log4j.PatternLayout
  log4j.appender.R.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n
  </code></pre>
  
  <p><strong>Following is the code to initialize logging</strong> in my main method </p>
  
  <pre><code>final String LOG_FILE = "C:/eclipse_workspace/lib/log4j.properties"; 
        Properties logProp = new Properties();      
        try     
        {      
         logProp.load(new FileInputStream (LOG_FILE));  
              PropertyConfigurator.configure(logProperties);      
              logger.info("Logging enabled");    
        }     
        catch(IOException e)                
        {       
       System.out.println("Logging not enabled");       
                   }  
  </code></pre>
  
  <p><strong>In every java class of the application I have the following code</strong></p>
  
  <pre><code>import org.apache.log4j.*;
  
  private static final Logger logger = Logger.getLogger(TheActualClassName.class); 
  </code></pre>
  
  <p>But <strong>I get the following warning messages when I run the app</strong>.</p>
  
  <p>log4j:WARN No appenders could be found for logger (com.xxx.myApp.MainProgram.MyFileName).
  log4j:WARN Please initialize the log4j system properly.
  log4j:WARN See <a href="http://logging.apache.org/log4j/1.2/faq.html#noconfig" rel="nofollow">http://logging.apache.org/log4j/1.2/faq.html#noconfig</a> for more info.</p>
  
  <p>What am I doing wrong?? The log file "application.log" is not being generated </p>