Hi All,
Greetings!!
I want to write captured regex results from HTTP responses to an external file. I already referred to this link (https://groups.google.com/forum/#!topic/gatling/hpUECuX9Fc4) but not able to find a correct syntax. Also I already have TRACE method enabled in logback.xml (attached the logback.xml with this message) it is working fine but since the HTTP responses are really huge , I just want to save specific values within HTTP response to a external file.
For now I am using the below code to write to a file I knew this is not threadsafe and does not support concurrency,
.exec( session => {
val fout = new FileWriter("CartID.log", true)
val fileout = new PrintWriter(new BufferedWriter(fout))
fileout.print(session( "cartID" ).as[String])
fileout.println()
fileout.close()
session})
I got to know that slf4j is a better method that supports concurrency, in this link https://groups.google.com/forum/#!topic/gatling/hpUECuX9Fc4 there is a small piece of code showing slf4j implementation within a scala file but that does not seem to work with latest version of Gatling even after importing the following slf4j packages . Looking forward to this forum to help me get away from this issue.
import org.slf4j.Logger._
import org.slf4j.LoggerFactory._
Regards,
Shobitha