title: How to print logs by using ExtentReports listener in java?
body: <p>Here I am using the listener for generating reports in HTML format but it is not printing the logs present in a test case.</p>
  
  <p><strong>Sample Test Cases</strong></p>
  
  <pre><code>@Test
  public void testRedirectAllControlScreen() throws Exception {
  
      reportLog("login using a valid IsoMetrix username and password.");
      HomePage homePage = loginPage.login("username", "password");
  
      reportLog("Go to All Control page");
      AllControlPage allControlPage = homePage.navigateToControlPage();
  
      reportLog("Verify All Control page");
      allControlPage.verifyAllControlPage();
  
  }
  </code></pre>
  
  <p><strong>Method Present in BaseClass</strong></p>
  
  <pre><code> public void reportLog(String message) {
      message = BREAK_LINE + message;
      logger.info("Message: " + message);
      Reporter.log(message);
  }
  </code></pre>
  
  <p><strong>ExtentReport Listener</strong></p>
  
  <pre><code> public class ExtentReporterNG implements IReporter {
  
  private ExtentReports extent;
  
  public void generateReport(List&lt;XmlSuite&gt; xmlSuites, List&lt;ISuite&gt; suites, String outputDirectory) {
      extent = new ExtentReports(outputDirectory + File.separator + "ExtentReport.html", true);
  
      for (ISuite suite : suites) {
          Map&lt;String, ISuiteResult&gt; result = suite.getResults();
  
          for (ISuiteResult r : result.values()) {
              ITestContext context = r.getTestContext();
              buildTestNodes(context.getPassedTests(), LogStatus.PASS);
              buildTestNodes(context.getFailedTests(), LogStatus.FAIL);
              buildTestNodes(context.getSkippedTests(), LogStatus.SKIP);
          }
      }
  
      extent.flush();
      extent.close();
  }
  
  private void buildTestNodes(IResultMap tests, LogStatus status) {
      ExtentTest test;
  
      if (tests.size() &gt; 0) {
          for (ITestResult result : tests.getAllResults()) {
              test = extent.startTest(result.getMethod().getMethodName());
              test.assignAuthor("360Log");
              test.setStartedTime(getTime(result.getStartMillis()));
              test.setEndedTime(getTime(result.getEndMillis()));
  
              for (String group : result.getMethod().getGroups())
                  test.assignCategory(group);
              int s = result.getStatus();
              if (result.getStatus() == 1) {
                  test.log(status, "Test " + status.toString().toLowerCase() + "ed");
              } else {
                  String screen = BaseTest.screen;
                  test.log(status, "Test " + status.toString().toLowerCase() + "ed " + test.addScreenCapture(screen));
  
              }
              extent.endTest(test);
          }
      }
    }
  
  }
  </code></pre>
  
  <p>PFA the screenshot. <a href="https://i.stack.imgur.com/MlbPv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MlbPv.jpg" alt="It doesn&#39;t print logs step wise."></a></p>