title: Java log4j not working
body: <p>I want to use log4j for generating the logs.
  For this I am using the following code :</p>
  
  <pre><code>package com.idm.Test;
  
  import org.apache.log4j.Logger;
  
  public class log4jExample {
      static Logger log = Logger.getLogger(log4jExample.class.getName());
  
      public static void main(String[] args) {
          log.info("Hello this is a debug message 1");
          log.info("Hello this is a debug message 2");
          log.info("Hello this is a debug message 3");
      }
  }
  </code></pre>
  
  <p>My log4j properties file is given below :</p>
  
  <pre><code># Define the root logger with appender file
  log=G:\\logs
  log4j.rootLogger = DEBUG, FILE
  
  # Define the file appender
  log4j.appender.FILE=org.apache.log4j.FileAppender
  log4j.appender.FILE.File=${log}\\log.out
  
  # Define the layout for file appender
  log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
  log4j.appender.FILE.layout.conversionPattern=%m%n
  </code></pre>
  
  <p>I want to generate log file inside</p>
  
  <pre><code>G:\logs\log.out
  </code></pre>
  
  <p>But the problem is that when I run this. There is no log file is created on this path.
  When I already created one file into that location with log.out name and run again it is not showing me the logs inside this file.</p>
  
  <p><strong>I put my log4j.properties file inside com.idm.Test package.</strong></p>