title: How would you implement so each Test class logs output to a separate file?
body: <p>Using Java, with either TestNG or JUnit, if you wanted to log some information gathered during a test to a file, and have each test class (such as <strong>TestClass1.class</strong>) keep a separate output file named after the class like so:</p>
  
  <pre><code>TestClass1.log
  </code></pre>
  
  <p>How would you implement this kind of thing?  I know log4j can log the class name in a 'per line' of output in a single file but I want outputs for each class to be in separate files.  Also, log4j can log output to different files based on package name.  Neither of those solutions is what I am looking for because <strong>I want hundreds of tests to create hundreds of log files</strong>.</p>