Home > database >  Jmeter CLI option to print logs in the Jenkins console
Jmeter CLI option to print logs in the Jenkins console

Time:03-19

Just curious whether we can get the jmeter logs printed in Jenkins console. This is what I am using in Jenkins to run the Jmeter

    sh "/home/jenkins/jmeter/apache-jmeter-5.1/bin/jmeter.sh -f -n -t my.jmx -l output.jtl -j jmeter.log -p my.properties -e -o results"
    archiveArtifacts '**/jmeter.log'

Above can generate the logfile and archive. My requirement is to see them in Jenkins console logs.

CodePudding user response:

You can try adding -j /dev/stdout switch to your command line, as per JMeter Documentation

-j, --jmeterlogfile jmeter run log file (jmeter.log)

and /dev/stdout is a Linux device file providing read/write access to STDOUT standard stream

Alternatively you can amend JMeter's logging configuration and add one more appender to print the log messages to the STDOUT as well.

And last but not the least according to JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.4.3 (or whatever is the latest stable version which is available at JMeter Downloads page)

  • Related