REST Assured can log request and response details for debugging with .log() methods: log().all(), log().body(), log().headers(), and conditional logging like log().ifValidationFails().
On the request side, given().log().all() prints method, URI, headers, params, and body. On the response, then().log().body() or .log().all() prints the response. For cleaner output, .log().ifValidationFails() logs only when an assertion fails — ideal for CI so passing tests stay quiet. You can also enable global logging (RestAssured.enableLoggingOfRequestAndResponseIfValidationFails()). Logging is invaluable when a test fails and you need to see exactly what was sent/received, but logging everything on every test creates noise, so prefer conditional logging in suites.
Debugging a failing assertion: adding .log().ifValidationFails() to both given() and then() prints the full request/response only for the failing case, making the mismatch obvious without flooding CI logs.
Your CI logs are flooded because every API test prints full request/response. How do you keep useful debug output without the noise?