title: How to get logs from current thread only in log4j
body: <p>I want to intercept logs from the specific thread in my application for the certain period of time. I'm using log4j. 
  The code below does that, but I'm getting logs from others threads too.</p>
  
  <pre><code>                WriterAppender appender = new WriterAppender(new PatternLayout("%d{ISO8601} %p - %m%n"), consoleWriter);
  
                  appender.setName("STR_APPENDER");
                  appender.setThreshold(org.apache.log4j.Level.INFO);
                  Logger.getRootLogger().addAppender(appender); 
                  //Some Logic here (I'm using other classes and jars here and I want to get this logs as well)
                  Logger.getRootLogger().removeAppender("STR_APPENDER");
  </code></pre>
  
  <p>I'm aware that Logger.getRootLogger() is not a good solution here, but I don't have any other idea.</p>