title: Getting error when trying to instantiate FileAppender in log4j
body: <p>This is the code:</p>
  
  <pre><code>PatternLayout patternLayout = new PatternLayout("%d{MM-dd-yyyy H:mm:ss.SSS} [%p] (%C{1}.%M) %n    %m");
  FileAppender fileAppender = new FileAppender(patternLayout, fileName);
  </code></pre>
  
  <p>The 2nd line is getting the following error:</p>
  
  <pre><code>Error:(40, 37) java: constructor FileAppender in class org.apache.logging.log4j.core.appender.FileAppender cannot be applied to given types;
    required: java.lang.String,org.apache.logging.log4j.core.Layout&lt;? extends java.io.Serializable&gt;,org.apache.logging.log4j.core.Filter,org.apache.logging.log4j.core.appender.FileManager,java.lang.String,boolean,boolean,org.apache.logging.log4j.core.net.Advertiser
    found: org.apache.log4j.PatternLayout,java.lang.String
    reason: actual and formal argument lists differ in length
  </code></pre>
  
  <p>However the <a href="https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/FileAppender.html" rel="nofollow">log4j javadocs</a> show that a constructor with a PatternLayout as its 1st parameter and a String as the 2nd parameter (for the file name) is a valid constructor.</p>