title: Log4j2 - Can I create a seperate log file for every cucumberJVM test where the log file name is that of the Scenario?
body: <p>Thanks for your time,</p>
  
  <p><strong>Task:</strong> I am running a lot of parallel tests using cucumberJVM / Maven Surefire (forkCount), upwards of around 15+  tests at the same time on my GRID setup.  Is it possible for me to have an individual log file per Junit @Test (with the test method as the log name) <strong>and</strong> each cucumberJVM Scenario to have a log for itself?</p>
  
  <p>I'm not sure if this is even viable but its something I am trying to achieve, I have basic logging so far that writes everything to one .log file, I am doing a lot of reading on log4j2 at the moment but the website is overwhelming so far.</p>
  
  <p><strong>my current log4j2.xml</strong> </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="WARN"&gt;
    &lt;Appenders&gt;
      &lt;File name="file" fileName="app.log"&gt;
        &lt;PatternLayout&gt;
          &lt;Pattern&gt;%d %p %c{1.} [%t] %m %ex%n&lt;/Pattern&gt;
        &lt;/PatternLayout&gt;
      &lt;/File&gt;
      &lt;Console name="STDOUT" target="SYSTEM_OUT"&gt;
        &lt;PatternLayout pattern="%m%n"/&gt;
      &lt;/Console&gt;
    &lt;/Appenders&gt;
    &lt;Loggers&gt;
      &lt;Root level="trace"&gt;
        &lt;AppenderRef ref="file" level="DEBUG"/&gt;
        &lt;AppenderRef ref="STDOUT" level="INFO"/&gt;
      &lt;/Root&gt;
    &lt;/Loggers&gt;
  &lt;/Configuration&gt; 
  </code></pre>
  
  <p>I am still investigating different types of appenders, is there any I should consider using for this task in particular?  I have a simple LoggerFactory which I am using to write to the Log</p>
  
  <pre><code>package supportFactory;
  
  
  
  import org.apache.logging.log4j.Logger;
  import org.apache.logging.log4j.LogManager;
  
  
  public class LoggingFactory {
  
  
      public static Logger Log = LogManager.getLogger();                                   
  
  
      public void debug(String message) {
          Log.debug("DEBUG: " + message); 
      }
  
      public void info(String message) {
          Log.debug("INFO: " + message);
      }
  
      public void warn(String message) {
          Log.debug("WARNING: " + message);
      }
  
      public void error(String message) {
          Log.debug("ERROR: " + message);
      }
  
      public void fatal(String message) {
          Log.debug("FATAL: " + message);
  
      }
  
  }
  </code></pre>
  
  <p>I am able to get the running scenario with the following in my @Before (hook):</p>
  
  <pre><code>    TestRunner.scenario = scenario;
      System.out.println("Scenario: " + scenario.getId());
  </code></pre>
  
  <p>This returns Feature AND scenario name, just this with a .log on the end would be brilliant per test run</p>
  
  <p>Any guidance is massively appreciated here.</p>