In this article we are going to see how can we change property of
JMeter.
Jmeter has a very big number of properties. In this section we will see the Log settings mention in jmeter.propertie.
In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad. We can find various properties which are activated and some are not yet activated.
For primary log format, see this
If we change the default format property, it will be change.
Default format:
log_format=%{time:yyyy/MM/dd HH:mm:ss} %5.5{priority} - %{category}: %{message} %{throwable}
- To set the log level up to package/class
log_level.[package_name].[classname]=[PRIORITY_LEVEL]
Example :
log_level.jmeter=INFO
log_level.jmeter.junit=DEBUG
log_level.jmeter.control=DEBUG
log_level.jmeter.testbeans=DEBUG
log_level.jmeter.engine=DEBUG
log_level.jmeter.threads=DEBUG
log_level.jmeter.gui=WARN
log_level.jmeter.testelement=DEBUG
log_level.jmeter.util=WARN
log_level.jmeter.util.classfinder=WARN
log_level.jmeter.test=DEBUG
log_level.jmeter.protocol.http=DEBUG
[For Cookie/Auth manager]
log_level.jmeter.protocol.http.control=DEBUG
log_level.jmeter.protocol.ftp=WARN
log_level.jmeter.protocol.jdbc=DEBUG
log_level.jmeter.protocol.java=WARN
log_level.jmeter.testelements.property=DEBUG
log_level.jorphan=INFO
-To categorize a log file
log_file.[category]=[filename]
[Note : Category is like package/class like above]
-To logs separately for Jmeter and Jorphan
log_file.jorphan=jorphan.log
log_file.jmeter=jmeter.log
-To log Combined(jmeter + jorphan)
log_file=jmeter.log
-To define formats in the JMeter LoggingManager
log_format_type=default [ thread_prefix/thread_suffix]
-thread_prefix adds the thread name as a prefix to the category
-thread_suffix adds the thread name as a suffix to the category
Note: Thread name is not included by default, as it requires extra processing.
----Spatial Logging for HttpClient------------
Commons HttpClient Logging information can be found at here.
-To set log level
log_level.org.apache.commons.httpclient=debug
-To log Authenticator
log_level.org.apache.commons.httpclient.Authenticator=trace
-To Show headers only
log_level.httpclient.wire.header=debug
-To set separate file for wire debug
log_level.httpclient.wire=debug
log_file.httpclient=httpclient.log
-To Enable header wire + context logging[Best for Debugging]
log_level.org.apache.http=DEBUG
log_level.org.apache.http.wire=ERROR
-To Enable full wire + context logging
log_level.org.apache.http=DEBUG
-To Enable context logging for connection management / request execution
log_level.org.apache.http.impl.conn=DEBUG
log_level.org.apache.http.impl.client=DEBUG
log_level.org.apache.http.client=DEBUG
...Thanks..:)
Jmeter has a very big number of properties. In this section we will see the Log settings mention in jmeter.propertie.
In the jmeter installed bin directory(in my case C:\apache-jmeter-2.8\bin), we get a file named jmeter.properties. Open this with note pad. We can find various properties which are activated and some are not yet activated.
For primary log format, see this
If we change the default format property, it will be change.
Default format:
log_format=%{time:yyyy/MM/dd HH:mm:ss} %5.5{priority} - %{category}: %{message} %{throwable}
- To set the log level up to package/class
log_level.[package_name].[classname]=[PRIORITY_LEVEL]
Example :
log_level.jmeter=INFO
log_level.jmeter.junit=DEBUG
log_level.jmeter.control=DEBUG
log_level.jmeter.testbeans=DEBUG
log_level.jmeter.engine=DEBUG
log_level.jmeter.threads=DEBUG
log_level.jmeter.gui=WARN
log_level.jmeter.testelement=DEBUG
log_level.jmeter.util=WARN
log_level.jmeter.util.classfinder=WARN
log_level.jmeter.test=DEBUG
log_level.jmeter.protocol.http=DEBUG
[For Cookie/Auth manager]
log_level.jmeter.protocol.http.control=DEBUG
log_level.jmeter.protocol.ftp=WARN
log_level.jmeter.protocol.jdbc=DEBUG
log_level.jmeter.protocol.java=WARN
log_level.jmeter.testelements.property=DEBUG
log_level.jorphan=INFO
-To categorize a log file
log_file.[category]=[filename]
[Note : Category is like package/class like above]
-To logs separately for Jmeter and Jorphan
log_file.jorphan=jorphan.log
log_file.jmeter=jmeter.log
-To log Combined(jmeter + jorphan)
log_file=jmeter.log
-To define formats in the JMeter LoggingManager
log_format_type=default [ thread_prefix/thread_suffix]
-thread_prefix adds the thread name as a prefix to the category
-thread_suffix adds the thread name as a suffix to the category
Note: Thread name is not included by default, as it requires extra processing.
----Spatial Logging for HttpClient------------
Commons HttpClient Logging information can be found at here.
-To set log level
log_level.org.apache.commons.httpclient=debug
-To log Authenticator
log_level.org.apache.commons.httpclient.Authenticator=trace
-To Show headers only
log_level.httpclient.wire.header=debug
-To set separate file for wire debug
log_level.httpclient.wire=debug
log_file.httpclient=httpclient.log
-To Enable header wire + context logging[Best for Debugging]
log_level.org.apache.http=DEBUG
log_level.org.apache.http.wire=ERROR
-To Enable full wire + context logging
log_level.org.apache.http=DEBUG
-To Enable context logging for connection management / request execution
log_level.org.apache.http.impl.conn=DEBUG
log_level.org.apache.http.impl.client=DEBUG
log_level.org.apache.http.client=DEBUG
...Thanks..:)
Hi Shantonu - I can't find a property called log_format in jmeter.properties. But I'm using Jmeter v5, so perhaps it has moved? Any ideas? Thanks.
ReplyDeleteHi Shantonu - I can't find a property called log_format in jmeter.properties. But I'm using Jmeter v5, so perhaps it has moved? Any ideas? Thanks.
ReplyDeleteare you trying to change http client logging format or jmeter's ?
Delete