milamberspace commented on code in PR #6882:
URL: https://github.com/apache/jmeter/pull/6882#discussion_r4736749649


##########
xdocs/usermanual/get-started.xml:
##########
@@ -722,6 +722,13 @@ LoggerFactory.getLogger(Foo.class);</source>
         to define the log file using the test plan name,
         e.g. for the test plan <code>Test27.jmx</code> the log file is set to 
<code>Test27.log</code>.
         </p>
+        <p>
+        The default <code>log4j2.xml</code> reads the log file name from the 
<code>jmeter.logfile</code> system property.
+        Logging is initialised before <code>system.properties</code> (or a 
file given with <code>-S</code>) is loaded,
+        so setting <code>jmeter.logfile</code> in those files has no effect.
+        Use the <code>-j</code> option, or pass 
<code>-Djmeter.logfile=/path/to/file.log</code> to the JVM through
+        <code>JVM_ARGS</code>, for example in <code>setenv.sh</code> or 
<code>setenv.bat</code>.

Review Comment:
   Users will likely try `jmeter -Djmeter.logfile=...` next; that `-D` is a 
JMeter option processed after logging is set up, so it does not work either. 
Maybe:
   
   ```suggestion
           <code>JVM_ARGS</code>, for example in <code>setenv.sh</code> or 
<code>setenv.bat</code>.
           A <code>-D</code> option given to JMeter itself (after the 
<code>jmeter</code> command) is also applied too late.
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to