Inserting custom request logs into simulation.log

I’d like to add my own entries to simulation.log, but previous posts all reference DataWriter.tell, which doesn’t seem to exist (or at least, the linked examples in the Gatling source don’t use it anymore). What’s the current way to write my own logs to simulation.log?

For reference (in case I’m just using it wrong), I tried this:

DataWriter.tell(session.scenarioName, session.userId, “SelectUser”, now, now, now, now, Status.valueOf(“KO”))

And got the following error:

value tell is not a member of object io.gatling.core.result.writer.DataWriter

https://github.com/excilys/gatling/blob/master/gatling-core/src/main/scala/io/gatling/core/result/writer/DataWriter.scala#L122

Did a quick search for “datawriterclient” to find out about usage and worked off the code for io.gatling.http.action.RequestAction. Works great, thanks!

The major things I was missing:

  • Import io.gatling.core.result.writer.DataWriterclient
  • Containing object extends DataWriterClient
  • Parameters are the session (NB not the session name and id, as with DataWriter.logRequest), the request name, the 4 time values (all now, since it’s not a real request), the status, and an optional error message