title: Slf4j or Logback: Turn off logging for 1 unit test (or 1 thread)
body: <p>I want to turn off logging for 1 unit test (which doesn't fail), so a stacktrace doesn't show up in the log. That stacktrace should be there in production runs because it's a failure-testing test.</p>
  
  <p>The production code looks like this:</p>
  
  <pre><code>boolean failed = false;
  for (int i = 0; i &lt; 10; i++) {
      try {
          // Possible submits on Executor to run on other thread (not that it matters)
          runTask(i); 
      } catch (RuntimeException e) {
          // In the unit test, this pollutes the test log // BAD, MY PROBLEM
          // In production, it shows up in the log immediately, before other tasks run // GOOD
          logger.warn("Task failed. Stacktrace:", e);
          failed = true;
      }
  }
  if (failed) {
      // The unit test checks if this exception is thrown,
      // (it doesn't pollute the test log)
      throw new IllegalStateException("at least 1 failed");
      // In the real implementation, this also chains the first exception, to avoid eating the stacktrace
  }
  </code></pre>
  
  <p>I have a unit test which tests that an executor throws an exception if at least 1 out of 10 tasks submitted to it fails. Because the executor can't fail when an inner exception occurs, it first runs the other tasks before throwing the outer exception. So when it catches the inner exception, it logs it, giving a stacktrace in the log. For QA, this is misleading, as the test logs show a stacktrace, despite that all tests succeeded. I want to get rid of that stacktrace in the test log (<a href="https://issues.jboss.org/browse/PLANNER-297" rel="noreferrer">jira</a>).</p>