title: Catch log4j2 LogEvents from a custom Listener
body: <p>Someone know if that's possible to make a listener on the log4j for catching every log from a named method/class ? The finality is to add the retrieved log into a JPanel.</p>
  
  <h2>log4j2.xml</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="ERROR" name="config"&gt;
      &lt;Properties&gt;
          &lt;Property name="LOG_DIR"&gt;logs&lt;/Property&gt;
          &lt;Property name="ARCHIVE"&gt;logs/archive&lt;/Property&gt;
          &lt;Property name="PATTERN"&gt;%-5level %d [%t] %c:%M(%L): %m%n&lt;/Property&gt;
      &lt;/Properties&gt;
      &lt;Appenders&gt;
          &lt;Console name="STDOUT" target="SYSTEM_OUT"&gt;
              &lt;PatternLayout pattern="${PATTERN}"/&gt;
          &lt;/Console&gt;
  
          &lt;RollingFile name="fileWriter"
                       fileName="${LOG_DIR}/logs.log"
                       filePattern="${ARCHIVE}/logs.log.%d{yyyy-MM-dd-hh-mm}.gz"&gt;
              &lt;PatternLayout pattern="${PATTERN}"/&gt;
              &lt;TimeBasedTriggeringPolicy/&gt;
          &lt;/RollingFile&gt;
      &lt;/Appenders&gt;
      &lt;Loggers&gt;
          &lt;Root level="INFO"&gt;
              &lt;AppenderRef ref="fileWriter"/&gt;
          &lt;/Root&gt;
      &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>
  
  <h2>Log example</h2>
  
  <pre><code>  public class MyClass() {
      private final static Logger logger = LogManager.getLogger();
  
      public void method() {
        logger.info("Some text...");
        logger.info("More text...");
      }
    }
  </code></pre>
  
  <p>Thanks!</p>