title: Logger in log4j is getting null
body: <p>I have configured log4j in my project.The <strong>properties file</strong> is as follows:</p>
  
  <pre><code># Log levels
  log4j.rootLogger=INFO,LOGFILE
  # Rolling File Appender
  
  log4j.appender.LOGFILE = org.apache.log4j.DailyRollingFileAppender
  log4j.appender.LOGFILE.File=D:/nova/logs/log
  log4j.appender.LOGFILE.Append = true
  log4j.appender.LOGFILE.Threshold=DEBUG
  log4j.appender.LOGFILE.DatePattern = '.'yyyy-MM-dd
  
  # Define the layout for file appender
  log4j.appender.LOGFILE.layout=com.utility.CustomizeHTMLLayout
  log4j.appender.LOGFILE.layout.LocationInfo=false
  
  log4j.logger.org.hibernate=FATAL
  </code></pre>
  
  <p>so in my java code i am <strong>initializing the LogManager</strong> by passing the class name:</p>
  
  <pre><code>private static Logger logger = Logger.getLogger("Admin Setting Manager");
  </code></pre>
  
  <p><strong><code>"Admin Setting Manager"</code></strong> is the class name.
  Then i am doing the following steps to get the root logger information and trying to save the log file in a new folder :  </p>
  
  <pre><code> DailyRollingFileAppender file1 = 
   (DailyRollingFileAppender) logger.getRootLogger().getAppender("LOGFILE");
  
          String username = createdUser.replace(".com", "");
    //createduser will have the username who is logging in the webpage
  
          String path = "D:/nova/logs/"+username+"/lg.log";
          file1.setFile(path);
  </code></pre>
  
  <p>Here I am trying to get the logged in username and trying to create a directory of the username and save the log for each user in their respective directory.</p>
  
  <p>But the logger is NULL every time.I am not able to understand that why the logger is not getting initialized.</p>
  
  <p>I googled it thoroughly but not able to get any solution regarding this.
  So please help me get trough this problem.</p>