Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override default log location for JMeter when launching with Java (not command line)

Tags:

java

jmeter

Is there an equivalent of the -j command-line option when launching JMeter using Java?

I'm running a series of test scripts that each need to have a custom log name - normally I'd just define each log location using -j, but in these cases they need to be launched through Java.

like image 961
STMM Avatar asked Apr 15 '26 10:04

STMM


1 Answers

  1. If you have possibility to amend the java code and invoke System.setProperty function :

    System.setProperty("jmeter.logfile", "/desired/path/to/jmeter.log)"
    
  2. If you don't:

    • either pass the property via -D command line argument like:

      java -Djmeter.logfile=/desired/path/to/jmeter.log ....
      
    • or add the next line to system.properties file:

      jmeter.logfile=/desired/path/to/jmeter.log 
      

More information:

  • JMeter Properties Reference
  • Apache JMeter Properties Customization Guide
  • Overriding Properties Via The Command Line
like image 124
Dmitri T Avatar answered Apr 16 '26 23:04

Dmitri T



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!