Access log sampler Step-by-step

This is a short tutorial on Jmeter's access log sampler. The purpose of the access log sampler is to provide an easy way to simulate production traffic. There are several benefits to using access logs.

rather than guess what users are doing, the test plan is using real traffic data

as the traffic pattern changes, the access log provides a record of individual changes and general shifts in usage

access logs contain a lot of useful data, which may provide some insight

access logs can be minded to determine different types of users

access logs can capture detailed session information

The down side of using access logs for test plans is you have to configure the webserver to output the request information. This may not be appropriate where security is an issue. For example, if the webserver dumps the post data from each request to the access logs, users login and password would be stored in plain text. Here are some general cases where access logs might be inappropriate.

security sensitive applications where the data is encrypted

the application does not allow fine grain control of which request parameters are written to the access logs

the webserver cannot be configured to append the post data to the access log

the webserver is hosting multiple applications, but doesn't provide a way to log the requests of one application to a separate file

To take advantage of access logs, the first thing is the webserver needs to be configured to use extended log format. Links for configuring the popular containers are provided below.

BEA Weblogic - http://e-docs.bea.com/wls/docs70/adminguide/web_server.html#113868

Tomcat - http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/valve.html

Websphere - http://e-docs.bea.com/wls/docs61/adminguide/web_server.html#113868

Resin - http://www.caucho.com/resin-3.0/config/log.xtp#access-log

In some cases, it may be desirable to write custom logging, so that sensitive information is not written to the access logs. This article does not cover the techniques for writing custom logging.

Step-by-Step

Start Jmeter

select “test plan”

right click add ->thread group

select thread group

right click add -> sampler -> access log sampler

right click on “thread group” add -> listener -> aggregate report

select the access log sampler

enter the ip address or hostname

enter the port

if you want to download the images, set “Parse images” to true.

Select a file for “log file location”

select aggregate report

enter “results.jtl” for filename

At this point, the test plan is ready. Start the test with CTRL-R or from the menu start -> run.

peter lin

2005-07-09T20:16:20