title: Is thier a way to log custom statements in Cucumber Extent Reports 4 instead using scenario.write method
body: <p>I don`t want to use the Scenario.write method but at the same i need to log my custom statements in Cucumber Extent report.</p>
  <p>The Reason why i am asking this question is when i use the scenario.write method it prints all the scenarios statements to all the outputs in extent report as shown in the image attached.</p>
  <p>So i am not sure of any other alternative ways to solve my issue and can somebody please pitchin and have look and provide me an solution for this.</p>
  <p>Below is my Runner class</p>
  <pre><code>@CucumberOptions(features = { &quot;classpath:featurefile&quot; }, glue = { &quot;classpath:com.hal.test.stepdefinition&quot;,
          &quot;classpath:com.hal.helper&quot; }, plugin = { &quot;pretty&quot;, &quot;json:target/Hal.json&quot;,
                  &quot;com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:&quot; }, monochrome = true, tags = {
                          &quot;@Api&quot;})
  
  
  
  public class HalTestRunner extends AbstractTestNGCucumberTests {
              
      @AfterClass(alwaysRun = true)
      public static void writeExtentReport() {
              
          ReporterUtil.archiveReport();
                  
      }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/sRhKo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sRhKo.jpg" alt="enter image description here" /></a></p>
  <pre><code>Below is my Pom.xml
  
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;HAL&lt;/groupId&gt;
      &lt;artifactId&gt;HALBRANDS&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;aspectj.version&gt;1.7.4&lt;/aspectj.version&gt;
          &lt;allure.version&gt;1.4.22&lt;/allure.version&gt;
          &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
          &lt;maven.surefire.verion&gt;2.22.0&lt;/maven.surefire.verion&gt;
          &lt;io.cucumber.verion&gt;4.2.0&lt;/io.cucumber.verion&gt;
  
      &lt;/properties&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.8.1&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;generate-sources&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;!-- &lt;configuration&gt; &lt;source&gt;${maven.compiler.source}&lt;/source&gt; &lt;target&gt;${maven.compiler.target}&lt;/target&gt; 
                      &lt;fork&gt;true&lt;/fork&gt; &lt;executable&gt;C:\Program Files\Java\jdk1.8.0_191\bin\javac&lt;/executable&gt; 
                      &lt;/configuration&gt; --&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.0.1&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;generate-sources&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;copy-resources&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;outputDirectory&gt;${basedir}/target/test-classes&lt;/outputDirectory&gt;
                              &lt;resources&gt;
                                  &lt;resource&gt;
                                      &lt;directory&gt;src/main/resources&lt;/directory&gt;
                                  &lt;/resource&gt;
                              &lt;/resources&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.22.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;systemPropertyVariables&gt;
                          &lt;propertyName&gt;java.library.path&lt;/propertyName&gt;
                          &lt;buildDirectory&gt;src/main/resources/configFile&lt;/buildDirectory&gt;
                          
                          &lt;cucumber.options&gt;${cucumber.options}&lt;/cucumber.options&gt;
                          
                      &lt;/systemPropertyVariables&gt;
                      &lt;testFailureIgnore&gt;true&lt;/testFailureIgnore&gt;
                      &lt;argLine&gt;
                          -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
                      &lt;/argLine&gt;
                      &lt;properties&gt;
                          &lt;property&gt;
                              &lt;name&gt;dataproviderthreadcount&lt;/name&gt;
                              &lt;value&gt;2&lt;/value&gt;
                          &lt;/property&gt;
                      &lt;/properties&gt;
                      &lt;suiteXmlFiles&gt;
                  
                          &lt;suiteXmlFile&gt;src/test/java/com/hal/brands/test/testng/testng.xml&lt;/suiteXmlFile&gt;
                      &lt;/suiteXmlFiles&gt;
                  &lt;/configuration&gt;
                  &lt;dependencies&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
                          &lt;artifactId&gt;aspectjweaver&lt;/artifactId&gt;
                          &lt;version&gt;${aspectj.version}&lt;/version&gt;
                      &lt;/dependency&gt;
                  &lt;/dependencies&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
                  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;9.2.10.v20150310&lt;/version&gt;
              &lt;/plugin&gt;
              &lt;!-- &lt;plugin&gt; &lt;groupId&gt;ch.fortysix&lt;/groupId&gt; &lt;artifactId&gt;maven-postman-plugin&lt;/artifactId&gt; 
                  &lt;version&gt;0.1.6&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;send_an_email&lt;/id&gt; 
                  &lt;phase&gt;test&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;send-mail&lt;/goal&gt; &lt;/goals&gt; &lt;inherited&gt;false&lt;/inherited&gt; 
                  &lt;configuration&gt; &lt;mailhost&gt;smtp.gmail.com&lt;/mailhost&gt; &lt;mailport&gt;465&lt;/mailport&gt; 
                  &lt;mailauth&gt;true&lt;/mailauth&gt; &lt;mailssl&gt;true&lt;/mailssl&gt; &lt;mailAltConfig&gt;true&lt;/mailAltConfig&gt; 
                  &lt;mailuser&gt;test12@gmail.com&lt;/mailuser&gt; &lt;mailpassword&gt;drv@123&lt;/mailpassword&gt; 
                  &lt;from&gt;test12@gmail.com&lt;/from&gt; &lt;subject&gt;UVS E-commerce Automation Report 
                  &lt;/subject&gt; &lt;failonerror&gt;true&lt;/failonerror&gt; &lt;htmlMessage&gt; &lt;![CDATA[ &lt;p&gt;Hi,&lt;/p&gt; 
                  &lt;p&gt;Check out the attached test execution report.&lt;/p&gt; &lt;p&gt;From,&lt;/p&gt; &lt;p&gt;Madhu 
                  Golla&lt;/p&gt; &lt;p&gt;UVS Automation Team&lt;/p&gt; ]]&gt; &lt;/htmlMessage&gt; &lt;receivers&gt; &lt;receiver&gt;Madhurrr@gmail.com&lt;/receiver&gt; 
                  &lt;receiver&gt;test12@gmail.com&lt;/receiver&gt; &lt;/receivers&gt; &lt;fileSets&gt; &lt;fileSet&gt; 
                  &lt;directory&gt;${basedir}/Automation_Report/Reports&lt;/directory&gt; &lt;includes&gt; &lt;include&gt;**/Report.html&lt;/include&gt; 
                  &lt;/includes&gt; &lt;/fileSet&gt; &lt;/fileSets&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; 
                  &lt;/plugin&gt; --&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencies&gt;
          &lt;!--Cucumber Dependencies --&gt;
  
  
          &lt;!-- cucumber-java --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-java&lt;/artifactId&gt;
              &lt;!-- &lt;version&gt;${io.cucumber.verion}&lt;/version&gt; --&gt;
              &lt;version&gt;4.2.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-jvm&lt;/artifactId&gt;
              &lt;!-- &lt;version&gt;5.1.0&lt;/version&gt; --&gt;
              &lt;version&gt;4.2.0&lt;/version&gt;
              &lt;type&gt;pom&lt;/type&gt;
          &lt;/dependency&gt;
  
          &lt;!--cucumber-jvm-deps &lt;dependency&gt; &lt;groupId&gt;io.cucumber&lt;/groupId&gt; &lt;artifactId&gt;cucumber-jvm-deps&lt;/artifactId&gt; 
              &lt;version&gt;1.0.6&lt;/version&gt; &lt;/dependency&gt; --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-core&lt;/artifactId&gt;
              &lt;!-- &lt;version&gt;5.1.0&lt;/version&gt; --&gt;
              &lt;version&gt;4.2.0&lt;/version&gt;
              &lt;!-- &lt;version&gt;1.2.6&lt;/version&gt; --&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-gherkin&lt;/artifactId&gt;
              &lt;!-- &lt;version&gt;3.2.0&lt;/version&gt; --&gt;
              &lt;version&gt;5.1.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- cucumber-testng --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-testng&lt;/artifactId&gt;
              &lt;!-- &lt;version&gt;${io.cucumber.verion}&lt;/version&gt; --&gt;
              &lt;version&gt;4.2.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- cucumber-picocontainer --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-picocontainer&lt;/artifactId&gt;
              &lt;version&gt;${io.cucumber.verion}&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  
          &lt;!-- https://mvnrepository.com/artifact/org.json/json --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.json&lt;/groupId&gt;
              &lt;artifactId&gt;json&lt;/artifactId&gt;
              &lt;version&gt;20180813&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.googlecode.json-simple&lt;/groupId&gt;
              &lt;artifactId&gt;json-simple&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
              &lt;artifactId&gt;poi-ooxml&lt;/artifactId&gt;
              &lt;version&gt;4.1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/com.github.cliftonlabs/json-simple --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.github.cliftonlabs&lt;/groupId&gt;
      &lt;artifactId&gt;json-simple&lt;/artifactId&gt;
      &lt;version&gt;3.1.0&lt;/version&gt;
  &lt;/dependency&gt;
          
  
          &lt;!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple --&gt;
          &lt;!-- &lt;dependency&gt; &lt;groupId&gt;com.googlecode.json-simple&lt;/groupId&gt; &lt;artifactId&gt;json-simple&lt;/artifactId&gt; 
              &lt;version&gt;1.1.1&lt;/version&gt; &lt;/dependency&gt; --&gt;
  
  
  
          &lt;!-- Logging --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.17&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;1.7.5&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Extent Reports --&gt;
          &lt;!-- &lt;dependency&gt; &lt;groupId&gt;com.vimalselvam&lt;/groupId&gt; &lt;artifactId&gt;cucumber-extentsreport&lt;/artifactId&gt; 
              &lt;version&gt;3.0.2&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;com.aventstack&lt;/groupId&gt; 
              &lt;artifactId&gt;extentreports&lt;/artifactId&gt; &lt;version&gt;3.1.2&lt;/version&gt; &lt;/dependency&gt; 
              &lt;dependency&gt; &lt;groupId&gt;com.relevantcodes&lt;/groupId&gt; &lt;artifactId&gt;extentreports&lt;/artifactId&gt; 
              &lt;version&gt;2.41.1&lt;/version&gt; &lt;/dependency&gt; --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.aventstack&lt;/groupId&gt;
              &lt;artifactId&gt;extentreports&lt;/artifactId&gt;
              &lt;version&gt;4.0.9&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- extentreports-cucumber4-adapter --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.aventstack&lt;/groupId&gt;
              &lt;artifactId&gt;extentreports-cucumber4-adapter&lt;/artifactId&gt;
              &lt;version&gt;1.0.7&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Testng --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.testng&lt;/groupId&gt;
              &lt;artifactId&gt;testng&lt;/artifactId&gt;
              &lt;version&gt;6.14.3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Selenium --&gt;
          &lt;!-- io.github.bonigarcia webdrivermanager --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;io.github.bonigarcia&lt;/groupId&gt;
              &lt;artifactId&gt;webdrivermanager&lt;/artifactId&gt;
              &lt;version&gt;3.5.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
              &lt;artifactId&gt;selenium-server&lt;/artifactId&gt;
              &lt;version&gt;3.141.59&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
              &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
              &lt;version&gt;4.0.0-alpha-4&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/com.paulhammant/ngwebdriver --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.paulhammant&lt;/groupId&gt;
              &lt;artifactId&gt;ngwebdriver&lt;/artifactId&gt;
              &lt;version&gt;1.1.4&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
              &lt;artifactId&gt;selenium-htmlunit-driver&lt;/artifactId&gt;
              &lt;version&gt;2.52.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- org.sikuli/sikuli-api --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.sikuli&lt;/groupId&gt;
              &lt;artifactId&gt;sikuli-api&lt;/artifactId&gt;
              &lt;version&gt;1.2.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
              &lt;version&gt;2.10.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- rest-assured-io --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.rest-assured&lt;/groupId&gt;
              &lt;artifactId&gt;rest-assured&lt;/artifactId&gt;
              &lt;version&gt;3.3.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- SQL SERVER JDBC DRIVER --&gt; 
          &lt;dependency&gt;
              &lt;groupId&gt;com.microsoft.sqlserver&lt;/groupId&gt;
              &lt;artifactId&gt;mssql-jdbc&lt;/artifactId&gt;
              &lt;version&gt;7.2.1.jre8&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/org.fusesource.jansi/jansi --&gt;
  
      &lt;/dependencies&gt;
      &lt;name&gt;HAL Brands&lt;/name&gt;
  &lt;/project&gt;
  </code></pre>