From 05f7602bb396a270fbcee4cd87ad0fd99ea4264c Mon Sep 17 00:00:00 2001 From: Peter Frank Date: Tue, 4 Apr 2017 21:55:34 -0700 Subject: [PATCH 1/2] gh-258: Added logging config for debugging to FAQ (#259) Changed the advice to use Spring Boot's logging common application property and linked to appropriate reference page for more information fixes gh-258 --- docs/src/main/asciidoc/verifier/introduction.adoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/src/main/asciidoc/verifier/introduction.adoc b/docs/src/main/asciidoc/verifier/introduction.adoc index e93dc0e438..2888de2086 100644 --- a/docs/src/main/asciidoc/verifier/introduction.adoc +++ b/docs/src/main/asciidoc/verifier/introduction.adoc @@ -817,3 +817,11 @@ The rest of the flow looks the same. Yes! Check out the https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html#_different_base_classes_for_contracts[Different base classes for contracts] sections of either Gradle or Maven plugins. + +==== How can I debug the request/response being sent by the generated tests client? + +The generated tests all boil down to RestAssured in some form or fashion which relies on https://hc.apache.org/httpcomponents-client-ga/[Apache HttpClient]. HttpClient has a facility called https://hc.apache.org/httpcomponents-client-ga/logging.html#Wire_Logging[wire logging] which logs the entire request and response to HttpClient. Spring Boot has a logging https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html[common application property] for doing this sort of thing, just add this to your application properties +[source,properties,indent=0] +---- +logging.level.org.apache.http.wire=DEBUG +---- From c8aeaa5c288a291fd91564c25df65782a95ecf8f Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Mon, 10 Apr 2017 14:34:16 +0200 Subject: [PATCH 2/2] Updated docs --- README.adoc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index 3887d8255b..74b7d142a0 100644 --- a/README.adoc +++ b/README.adoc @@ -1396,7 +1396,7 @@ Example of a `pom.xml` inside the `server` folder. UTF-8 1.8 - 1.0.4.BUILD-SNAPSHOT + 1.0.5.BUILD-SNAPSHOT Camden.BUILD-SNAPSHOT true @@ -1611,6 +1611,14 @@ The rest of the flow looks the same. Yes! Check out the https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html#_different_base_classes_for_contracts[Different base classes for contracts] sections of either Gradle or Maven plugins. +==== How can I debug the request/response being sent by the generated tests client? + +The generated tests all boil down to RestAssured in some form or fashion which relies on https://hc.apache.org/httpcomponents-client-ga/[Apache HttpClient]. HttpClient has a facility called https://hc.apache.org/httpcomponents-client-ga/logging.html#Wire_Logging[wire logging] which logs the entire request and response to HttpClient. Spring Boot has a logging https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html[common application property] for doing this sort of thing, just add this to your application properties +[source,properties,indent=0] +---- +logging.level.org.apache.http.wire=DEBUG +---- + === Links Here you can find interesting links related to Spring Cloud Contract Verifier: