title: LOG4J1.x to LOG4J2
body: <p>I would like to check on the following piece of code where I am stuck at from migrating from LOG4J1.X to LOG4J2. </p>
  
  <pre><code>File f = new File(fullFilePath);
  Enumeration apps = logger.getAllAppenders();
  if(!f.exists() || !apps.hasMoreElements())
  {
  logger.removeAllAppenders();
  appender = new FileAppender();
  appender.setName(fileName);
  logger.addAppender(appender);
  logger.setLevel(Level.toLevel(level));
  }
  </code></pre>
  
  <p>I could convert the rest of the code successfully to log4j2, however the <em>removeAllAppenders</em>, <em>getAllAppenders</em>, <em>addAppender</em>, <em>setLevel</em> functions are not available under log4j2. Hence, how do I go about replacing them?</p>