Debugging guide

Debug Gatling scripts by printing session values or with logback.

Printing Session Values

Print a session value.

.exec(session -> {
  return session;
.exec { session ->
.exec { session =>


There’s a logback.xml file in the Gatling conf directory. You can either set the log-level to TRACE to log all HTTP requests and responses or DEBUG to log failed HTTP request and responses.

<!-- 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" />-->

It will by default print debugging information to the console, but you can add a file appender:

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
    <pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>

And reference that appender:

<root level="WARN">
  <appender-ref ref="FILE" />

This can be useful if you run at one user and remove all logging apart from the HTML, and open the file in your browser.

Edit this page on GitHub