How do I view response bodies (via logback)?

Edited logback, to get more debug

Works nicely, can see more request info plus high level reply info, but no reply body.

e.g.

HTTP response:
status=
200 OK
headers=
Server: [Apache-Coyote/1.1]
x-capi-error-code: [00]
Content-Type: [application/xml]
Content-Length: [717]

What am I doing wrong?

I can do a

.check(bodyString.saveAs(“getProduct_reply”))

then

.exec(session=>{println(“getProduct_reply:” +session(“getProduct_reply”).as[String]);session})

but really want to see all response bodies

Thanks.

Dino.

Hi,

Do you have any check on the response body for this request in your simulation ?

To avoid storing the response body if it’s not needed, Gatling discards it, unless

  • it’s needed, because you’re doing a check on it

  • Or you ask Gatling to keep it even if you’re not doing any checks on it
    You have two ways to disable the response body discarding :

  • At the simulation level, by adding .disableResponseChunksDiscarding to your httpProtocol configuration

  • Globally, by uncommenting discardResponseChunks (just delete the # in front of it) in gatling.conf and setting it to false (it’s located in the http section of gatling.conf)
    After you disable the response body discarding, you should see the response body in the logs.

Cheers,

Pierre

No, I’m not.

Thanks for the tip. However did:

httpProtocol.disableReponseChunksDiscarding

Still no output of http return body

Also changing the conf file made no difference.

Am using the 2.0.0.2.x

Even a check(bodyString.exists)

makes no difference.

However there is certainly a body, which I can see in the session if I say:

.check(bodyString.saveAs(“bodyString”))

Dino.

When I configure my httpProtocols, I add this in to the chain:

.extraInfoExtractor((status: Status, session: Session, req: Request, res: Response) => {
List(req.getUrl, res.getStatusCode, res.getResponseBody)
})

That adds it to the simulation.log

@Dino As for your other questions, I think that you’re using an old timestamp/temporary version. Could you please upgrade to M3a, please?

Thanks for the heads up, was using the maven architype and just assumed it was the latest, doh!

Dino.