Hi,
where to see the response body and header of the executed scala/gatling script?
You can see the response along with headers in the console itself by setting log level to Trace.
Or you can write it to a file as well.
The requests and responses printed in the simulation.log file under target\gatling
In order to do that, you need to enable tracing in the logback.xml. ( I’ve used and tested this in Gatling v3.0.2)
Here is the content of logback.xml. This file can be found under src/test/resources
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<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>
<!-- 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" />
<appender name="ERROR" class="ch.qos.logback.core.FileAppender">
<file>target/gatling/simulation-errors.log</file>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
</encoder>
<immediateFlush>false</immediateFlush>
<param name="Append" value="false" />
</appender>
<!--<logger name="io.gatling.http.ahc" level="DEBUG" additivity="false">-->
<!--<appender-ref ref="ERROR"/>-->
<!--</logger>-->
<!-- Set level to TRACE to log everything and DEBUG to log in case of errors-->
<logger name="io.gatling.http.engine.response" level="TRACE" additivity="false">
<appender-ref ref="ERROR"/>
</logger>
<root level="WARN">
<appender-ref ref="CONSOLE" />
</root>
</configuration>