title: Print app logs into console while running intigration tests in Gradle
body: <p>I have beow tasks in my <code>build.gradle</code> and just wanted to findout whether I can print the app logs while running test task.</p>
  <p>The problem with below code is, need to quit from bootRunStartDaemon to go on to next task. So in that case cannot see app logs anymore.</p>
  <pre><code>    def process;
      tasks.register('bootRunStartDaemon') {
          doLast {
      
              ProcessBuilder builder = new ProcessBuilder(gradleCommand, &quot;bootRun&quot;, &quot;--args='--spring.profiles.active=it'&quot;)
              builder.redirectErrorStream(true)
              builder.directory(projectDir)
              process = builder.start()
      
              InputStream stdout = process.getInputStream()
              BufferedReader reader = new BufferedReader(new InputStreamReader(stdout))
  
              while ((line = reader.readLine()) != null) {
                   println line
  
                 }
      
          }
      }
      
  tasks.register('bootRunStopDaemon') {
      doLast {
          process.destroy();
          process.waitFor();
  
          if (process.isAlive()) {
              process.destroyForcibly();
          }
      }
  }
  
      task healthCheck(dependsOn: bootRunStartDaemon) {
         // some code
      }
      
      tasks.register('integrationTest', Test ) {
          description = 'Run integration tests.'
          check.dependsOn integrationTest
          group = 'verification'
          testClassesDirs = sourceSets.integrationTest.output.classesDirs
          classpath = sourceSets.integrationTest.runtimeClasspath
      }
      
      tasks.withType(Test) {
          useJUnitPlatform()
          // Prints any test outcomes to the console
          testLogging {
              events &quot;passed&quot;, &quot;skipped&quot;, &quot;failed&quot;
              showStackTraces true
              showExceptions true
              showCauses true
              exceptionFormat &quot;full&quot;
          }
      }
      
      
      bootRunStopDaemon.dependsOn(bootRunStartDaemon)
      healthCheck.dependsOn(bootRunStartDaemon)
      integrationTest.dependsOn(healthCheck)
      integrationTest.finalizedBy aggregate, bootRunStopDaemon
  </code></pre>