0

I have followed the instructions from this StackOverflow answer which causes JMeter to be opened when double clicking on a .jmx file in Windows.

The problem is that when I open a .jmx file by double clicking on the file it automatically creates a JMeter log file (and names it [name_of_jmx_file].log, regardless of if you do anything with the test. The file is also not removed once you close JMeter, so I have to manually delete it each time.

This appears to be caused by the -j param in the following line from the default jmeter-t.cmd file:

call "%~dp0"jmeter -j "%~n1.log" -t "%~nx1" %2 %3 %4 %5 %6 %7 %8 %9

Simply removing -j "%~n1.log" doesn't prevent the creation of the logfile as JMeter still creates the file and just defaults the name of the file to jmeter.log.

lax1089
  • 3,403
  • 3
  • 17
  • 37

2 Answers2

0

I have found a workaround which simply puts these auto-generated log files into a specific folder which I just periodically delete. This prevents the file from getting created in the same directory as the script which was the main inconvenience, though ideally I would like to figure out how to prevent the creation of this file entirely.

My workaround was to change the following line of the jmeter-t.cmd file:

call "%~dp0"jmeter -j "%~n1.log" -t "%~nx1" %2 %3 %4 %5 %6 %7 %8 %9

To this:

call "%~dp0"jmeter -j "C:\Users\[WINDOWS_USER]\Documents\JMeterRunLogs\%~n1.log" -t "%~nx1" %2 %3 %4 %5 %6 %7 %8 %9
lax1089
  • 3,403
  • 3
  • 17
  • 37
0

There is log4j2.xml file in "bin" folder of your JMeter installation, if you look for this line:

<File name="jmeter-log" fileName="${sys:jmeter.logfile:-jmeter.log}" append="false">

and change ${sys:jmeter.logfile:-jmeter.log} to

C:\Users\[WINDOWS_USER]\Documents\JMeterRunLogs\jmeter.log

JMeter log file will always be generated under that folder no matter where you launch JMeter from.

More information:

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • That is helpful, but what if I just want to make it not generate a log file anywhere? Or at least remove the log file[s] as soon as I close Jmeter – lax1089 Aug 27 '20 at 16:41