You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by "khuntly (via GitHub)" <gi...@apache.org> on 2023/02/08 19:32:06 UTC

[GitHub] [jmeter] khuntly opened a new issue, #5771: JMeter appears to ignore the -S value

khuntly opened a new issue, #5771:
URL: https://github.com/apache/jmeter/issues/5771

   ### Expected behavior
   
   JMeter executed as follows:
   
   `jmeter -p .\user.properties -i .\logging.xml -S .\system.properties`
   
   system.properties contains overrides for Java networking and the jmeter logfile:
   
   `jmeter.logfile=/path/to/logfile.log`
   
   Expected results:
   
   JMeter logfile is created and written to as `/path/to/logfile.log`
   
   ### Actual behavior
   
   Logfile is ALWAYS written as jmeter.log, regardless of log4j2.xml configuration or the settings in system.properties
   
   ### Steps to reproduce the problem
   
   Generate a system properties file that overrides jmeter.logfile
   Run jmeter with the -S parameter
   
   ### JMeter Version
   
   5.5
   
   ### Java Version
   
   java version "18.0.1.1" 2022-04-22
   
   ### OS Version
   
   Microsoft Windows [Version 10.0.19045.2546]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [jmeter] FSchumacher commented on issue #5771: JMeter appears to ignore the -S value

Posted by "FSchumacher (via GitHub)" <gi...@apache.org>.
FSchumacher commented on issue #5771:
URL: https://github.com/apache/jmeter/issues/5771#issuecomment-1509696309

   JMeter sets system properties relatively late in its lifecycle (after setting up logging). You can get around this by specifying those system properties by setting it via `JVM_ARGS`.
   On linux you can achieve it by running jmeter via
   ```console
   JVM_ARGS=-Djmeter.logfile=/tmp/my-jmeter.log ./bin/jmeter
   ```
   If you want to set the vars permanently, you can set them via `bin/setenv.sh` (on linux) or `bin/setenv.bat` (on windows).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [jmeter] Ninja-Cyborg commented on issue #5771: JMeter appears to ignore the -S value

Posted by "Ninja-Cyborg (via GitHub)" <gi...@apache.org>.
Ninja-Cyborg commented on issue #5771:
URL: https://github.com/apache/jmeter/issues/5771#issuecomment-1509428327

   In documentation it's mentioned that 3.2 onwards, Jmeter use configuration from log4j2 configuration file instead system.properties: https://jmeter.apache.org/usermanual/get-started.html#logging
   
   Since by default the location is read through log4j2.xml file, configuration through system.properties may got ignored. Modifying filename through log4j2.xml was successful, but it is not cleanest. 
   
   # Create new log file (work around)
   - log4j2.xml Original line of code: <File name="jmeter-log" fileName="${sys:jmeter.logfile:-jmeter.log}"  append="false">
   - ![image](https://user-images.githubusercontent.com/66517017/232174040-f8da64a0-5f6a-45ad-a11d-c0951797b501.png)
   - Modified code: <File name="jmeter-log" fileName="${sys:jmeter1.logfile:-logfileQ.log}"  append="false">
   - ![image](https://user-images.githubusercontent.com/66517017/232173951-fc4e3991-fe67-4462-87c6-7c86b321d878.png)
   - Replace logfileQ.log with desired file name
   - Changed the name of XQuery variable(jmeter.logfile) to make it work
   
   ## Reason: Changing variable name (sys:jmeter.logfile)
   - I could not find how and where the variable for filename, been used. So, to change the logfile name, the variable name was changed. Otherwise, no new file gets generated.
   - This will create a new log file as specified, but the logs still get duplicated in jmeter.log file
   - Knowing the use of variable may help avoid changing default variable name
   
   ## JMeter Version
   5.5
   
   ## Java Version
   java version "18.0.2.1" 2022-08-18
   
   ## OS Version
   Microsoft Windows 10 Pro [Version:19044.2486]
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [jmeter] khuntly commented on issue #5771: JMeter appears to ignore the -S value

Posted by "khuntly (via GitHub)" <gi...@apache.org>.
khuntly commented on issue #5771:
URL: https://github.com/apache/jmeter/issues/5771#issuecomment-1423262712

   After a little further experimentation, it appears to only be ignoring the jmeter.logfile property. Other properties seem to work fine


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org