I would like to see what is in the body of the post that I am sending in my script. In fact, I would like to see the request, request body and response. From looking at the docs
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
<immediateFlush>false</immediateFlush>
</encoder>
</appender>
<timestamp key="timestamp" datePattern="yyyy-MM-dd'T'HH:mm:ss"/>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>logs/test_${timestamp}.log</file>
<append>true</append>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
</encoder>
</appender>
<!-- TRACE logs all HTTP requests/response, DEBUG logs only failed HTTP requests/response-->
<logger name="io.gatling.http.engine.response" level="TRACE" />
<root level="INFO">
<appender-ref ref="FILE" />
<appender-ref ref="CONSOLE"/>
</root>
Just choose the root level as DEBUG
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
</encoder>
<immediateFlush>false</immediateFlush>
</appender>
<logger name="io.gatling.http.engine.response" level="DEBUG" />
<root level="DEBUG">
<appender-ref ref="CONSOLE" />
</root>
Uncommenting only TRACE and leaving DEBUG commented helped.
An update with Gatling 3.x, the comment in logback.xml
is quite self-explain
<!-- uncomment and set to DEBUG to log all failing HTTP requests -->
<!-- uncomment and set to TRACE to log all HTTP requests -->
<!-- <logger name="io.gatling.http.engine.response" level="TRACE" />-->
After uncomment the above config we can get the request url, request header, response etc in the log or IDE'S console. That's very helpful to verify the dynamic feeder value used in request url or body, and it's the way to debug the failed requests.
Add this to your logback.xml
<logger name="io.gatling.http.ahc" level="DEBUG" />
This will print following details for each failure -