title: How to suppress ERROR logging in the unit tests
body: <p>In the TestNG unit test, I test, that an exception is caught and logged.</p>
  
  <p>This code is being tested </p>
  
  <pre><code>    try {
          workloadServiceImpl.actionStarted(resourceType);
      } catch (Exception e) {
          LOGGER.error("Error measuring workload during actionStarted, resourceType=" + resourceType + ": " + e.getMessage(), e);
      }
  </code></pre>
  
  <p>by this test</p>
  
  <pre><code>@Test
  public void testMeasureWorkflow_actionStartedExceptionCaught() throws Throwable {
      doThrow(new RuntimeException()).when(workloadService).actionStarted(any());
      tested.measureWorkloadForDatabase(joinPoint);
  }
  </code></pre>
  
  <p>However during unit tests I don't want the exception to be logged. It catches other developers attention if they see it and then they waste time, by wondering, why is there an exception in log. Is there a mechanism, how to suppress logging of this exception during unit tests? We use logback, but logback-test.xml is being used also by integration tests and in that kind of test I don't want to suppress the exception logging, so fixing it in logback-test.xml file is not the preferred way.</p>