Request Logging
Grinder will normally log all of your HTTP requests. So at least for the request logging, the default behaviour may be good enough for you. Look for a log file with a name like
<hostname>-0.log
In this file, you'll see your requests, plus the server response codes.
If you want to explicitly log your http request from your code, you'll need to use a slightly different pattern than the one you are currently using.
request1501.setUrl('/webdynpro/call_agent_dtop-login_wd/COPSApp')
response1501=request1501.GET()
log(request1501.getUrl())
Response Logging
When logging the HTTP response, you need to deal with the body and the headers separately. Based on your code example above, you could log the body like this:
log(response1501.getText())
There are a couple of ways you can log the HTTP response headers. The easiest way would be to dump them all to the log in a single statement, like this:
log(response1501.toString())
To get an idea of the other options for logging http response headers, and the different things you can access separately, see the HTTPResponse API here:
http://grinder.sourceforge.net/g3/script-javadoc/HTTPClient/HTTPResponse.html
Login
In your question, you also asked "what do i need to do in order to login". I assume this is a typo, and that what you really mean is how do you write stuff to the log. To do an actual login, you need to submit a username and password, typically via HTTP post. Grinder can do this for you easily enough, but that topic should be addressed in a separate question.
from net.grinder.script import Test
from net.grinder.script.Grinder import grinder
from net.grinder.plugin.http import HTTPPluginControl,
HTTPRequest
from HTTPClient import NVPair
connectionDefaults = HTTPPluginControl.getConnectionDefaults()
httpUtilities = HTTPPluginControl.getHTTPUtilities()
– Arvind Jul 09 '12 at 04:21