1

I have several JMeter variables that are read in from User-Defined Properties, read from a CSV, or extracted from an HTTP response.

I need to be able to output the variables in a log file, and want to include them in the jmeter.log for now. I know how to use the Debug Sampler to view them in the JMeter UI, but it does not seem that they are being saved to jmeter.log.

Is it possible to configure JMeter to log the output of the Debug Sampler in jmeter.log, and if so, how?

asked Aug 13, 2020 at 9:25

1 Answer 1

1

The easiest way is using an appropriate JSR223 Test Element and simple Groovy script like:

vars.entrySet().each { var -> log.info(var.key + '=' + var.value) }

Demo:

enter image description here

Where:

More information: Top 8 JMeter Java Classes You Should Be Using with Groovy

answered Aug 13, 2020 at 15:19

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.