title: ClasscastException - org.apache.log4j.Logger cannot be cast to org.owasp.esapi.Logger - log4j to log4j2
body: <p>I am working on upgrading log4j to log4j2. In that process I am getting a Logger Class cast exception. Below is the error.</p>
  
  <pre><code>Caused by: java.lang.ClassCastException: org.apache.log4j.Logger cannot be cast to org.owasp.esapi.Logger
      at org.owasp.esapi.reference.Log4JLogFactory.getLogger(Log4JLogFactory.java:88)
      at org.owasp.esapi.ESAPI.getLogger(ESAPI.java:154)
      at org.owasp.esapi.reference.DefaultEncoder.&lt;init&gt;(DefaultEncoder.java:75)
      at org.owasp.esapi.reference.DefaultValidator.&lt;clinit&gt;(DefaultValidator.java:91)
      ... 45 more
  </code></pre>
  
  <p>In my old code( log4j properties file) I see a reference to this Logger. 
  Below is the code that we have in our old code.</p>
  
  <pre><code>log4j.loggerFactory=org.owasp.esapi.reference.Log4JLoggerFactory
  </code></pre>
  
  <p>Now in log4j2 I am using log4j2.xml file and I didn't find any tag equivalent to that line. Could any please suggest me how to proceed?<br>
  Note: I am running my application in JBoss EAP 7</p>