text: I am testing a webapp, i want to log all http request and response, how do i do that? I am just writing log = grinder.logger.info def page15(self):
  """GET COPSApp (request 1501)."""
  result = request1501.GET('/webdynpro/call_agent_dtop-login_wd/COPSApp')
  log("-----------------------------------")
  But it is not logging. what do i need to do in order to login
  load-testing stress-testing grinder share|improve this question asked Jul 6 '12 at 7:11
  <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())
  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
  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.
  3,01021833
  Thanks for your reply , I came to know many thing by your answer, I am still facing problem that i am not able to log anything even simple text like my name etc. log = grinder.logger.info i have wiritten this in starting of my .py file and than written log("-----------------------------------") in some method . Do i need to import some package or sth else . I just want to log a simple text in some of calling function . Thanks a lot
  Jul 9 '12 at 4:16
  And in my .py file start with <br> from net.grinder.script import Test<br> from net.grinder.script.Grinder import grinder<br> from net.grinder.plugin.http import HTTPPluginControl,<br> HTTPRequest<br> from HTTPClient import NVPair<br> connectionDefaults = HTTPPluginControl.getConnectionDefaults()<br> httpUtilities = HTTPPluginControl.getHTTPUtilities()<br>
  is it possible (for debugging purposes) to control the log output and have grinder log to e.g. '<hostname>.log' all the time?
  for me it works like this: from net.grinder.script.Grinder.grinder import logger as log log.info("-----------")
  Not the answer you're looking for?	Browse other questions tagged load-testing stress-testing grinder or ask your own question.	asked