I need to implement an output file for my tests with gatling. Basically, the scenario is taking a csv of subscriptions IDs to work on, another csv for users.
This subscription scenario has multiple cases in it, it can be green (accepted), orange (waiting for approval of a manager), red (refused) or black (technical error).
What I need is to output a csv/log file giving me for each input subscription ID the matching colored result.
Do you think logback can be used to do this directly from gatling dsl ? Or should I write a custom check or another component so i can output directly to log file
Absolutely, you can use Logback. Create the logger and then, just call it from an exec() block.
exec((session:Session) => logger.info(“lorem ipsum”); session)
I have a similar scenario wherein I want to write logs to a file. I tried the below:
modified logback.xml to declare the new log file.
Inside the code, wrote - val logger = org.slf4j.LoggerFactory.getLogger(“myUserTracker”)
logger.info(“ggg”)
But nothing is written to log file though the file is created.