# is there a way to print on failure?

**URL:** <https://community.gatling.io/t/is-there-a-way-to-print-on-failure/1762>\
**Category:** Gatling (Open-Source)\
**Created:** [December 1, 2014, 11:52am UTC](https://community.gatling.io/t/is-there-a-way-to-print-on-failure/1762 "2014-12-01T11:52:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Jenkins](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@Paul\_Jenkins](https://community.gatling.io/u/Paul_Jenkins)\
**Post date:** [December 1, 2014, 11:52am UTC](https://community.gatling.io/t/is-there-a-way-to-print-on-failure/1762/1 "2014-12-01T11:52:55Z")

</div>

Hi, very new to gatling, scala etc so please accept my apologies…

Using the following example…

```auto
val scn = scenario("Scenario Name").repeat(repeatTimes) {
 feed(cNumbers)
  .exec(http("request_1")
  .get("/c/" + "${c_number}")
  .queryParam( """access_token""", """$£$£""")
  check (status.is(200))
  check (jsonPath("$.c_name").is("${name}"))
  check (jsonPath("$.type").is("${c_type}"))

  )
}

```

```auto

```

```auto
If any of the Checks fail, is there a way to simply print out the c_number data that was fed in so that I can find out where something failed and just check if it was data issue ?

```

```auto

```

```auto
I've tried to put a println in there but it doesn't seem to like it! Where would I put it?

```

```auto

```

```auto
Thank you in advance

```

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [December 1, 2014, 12:36pm UTC](https://community.gatling.io/t/is-there-a-way-to-print-on-failure/1762/2 "2014-12-01T12:36:39Z")

</div>

Either enable the proper logging level in logback.xml, or dump some extra data in the log file: [http://gatling.io/docs/2.0.3/http/http\_protocol.html#dumping-custom-data](http://gatling.io/docs/2.0.3/http/http_protocol.html#dumping-custom-data)

---

<div class="post-metadata">

**Author:** ![Paul\_Jenkins](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@Paul\_Jenkins](https://community.gatling.io/u/Paul_Jenkins)\
**Post date:** [December 1, 2014, 1:33pm UTC](https://community.gatling.io/t/is-there-a-way-to-print-on-failure/1762/3 "2014-12-01T13:33:34Z")

</div>

I put the following:

```auto
.extraInfoExtractor(extraInfo => List(extraInfo.request))

```

```auto

```

```auto
And this is outputting all the request into the log which is great.

```

```auto

```

```auto
1. is this log file limited by space? If so I assume this will fill up?

```

```auto

```

```auto
2. Is there a way of limiting it to results that were KO only? istead of showing OK and KO? if so what do i add?

```

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [December 1, 2014, 2:31pm UTC](https://community.gatling.io/t/is-there-a-way-to-print-on-failure/1762/4 "2014-12-01T14:31:04Z")

</div>

```auto
(extraInfo => if (somethingYouCanEasilyGuess) List(extraInfo.request) else Nil)

```

---

<div class="post-metadata">

**Author:** ![Paul\_Jenkins](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@Paul\_Jenkins](https://community.gatling.io/u/Paul_Jenkins)\
**Post date:** [December 1, 2014, 2:55pm UTC](https://community.gatling.io/t/is-there-a-way-to-print-on-failure/1762/5 "2014-12-01T14:55:40Z")

</div>

Thanks
