Gradle-built Generic Java Application Test Logging: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Gradle-built Spring Framework Application Test Logging")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=Internal=


* [[Testing_with_Gradle_Java_Plugin#Testing_Logging|Testing with Gradle Java Plugin]]
* [[Spring_Framework_Testing_Concepts#Test_Logging|Gradle-built Spring Framework Application Test Logging]]
* [[Spring_Framework_Testing_Concepts#Test_Logging|Gradle-built Spring Framework Application Test Logging]]
=Overview=
When building with Gradle a generic Java application, stdout and stderr of the tests being executed will be shown at the console if the following are configured:
* Set <tt>testLogging.showStandardStreams</tt> of the Java plugin Test task, as shown here: [[Testing_with_Gradle_Java_Plugin#Show_stdout_and_stderr_of_the_Test_JVM_on_the_Console|Show stdout and stderr of the Test JVM on the Console]].
* Make sure that a log4j slf4j binding is in the test classpath:
<syntaxhighlight lang='groovy'>
dependencies {
    implementation "org.slf4j:slf4j-api:1.7.23"
    implementation "org.slf4j:slf4j-log4j12:1.7.23"
}
</syntaxhighlight>
* Place a [[Simple_log4j.xml_Example|log4j.xml]] configuration in src/test/resources.

Latest revision as of 06:01, 7 April 2019

Internal

Overview

When building with Gradle a generic Java application, stdout and stderr of the tests being executed will be shown at the console if the following are configured:

dependencies {
    implementation "org.slf4j:slf4j-api:1.7.23"
    implementation "org.slf4j:slf4j-log4j12:1.7.23"
}
  • Place a log4j.xml configuration in src/test/resources.