You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by lo...@fastmail.fm on 2014/06/02 13:32:26 UTC
log HTTP request on error
Hi,
Is it possible to log a HTTP request upon error?
I am currently using a BeanShell Listener to log the ResponseData if not
successful.
if (!sampleResult.isSuccessful()) {
log.error(sampleResult.getResponseDataAsString());
}
}
But not sure how to log the HTTP request which caused this error.
Many Thanks
Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org
Re: log HTTP request on error
Posted by ZK <st...@gmail.com>.
HI,
try this:
log.error("ERROR URL="+prev.getUrlAsString());
ZK
--
View this message in context: http://jmeter.512774.n5.nabble.com/log-HTTP-request-on-error-tp5720158p5720160.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org
Re: log HTTP request on error
Posted by Shmuel Krakower <sh...@gmail.com>.
You can go with a simpler approach.
Add a root element of any listener, check the errors only box, select the
fields you want to log and set the filename to save errors to.
You will have a log of all errors you got during the test. I use this
always to log everything including request and response body to be able to
tackle errors easily.
www.beatsoo.org - free application performance monitoring from world wide
locations.
On Jun 2, 2014 2:32 PM, <lo...@fastmail.fm> wrote:
> Hi,
>
> Is it possible to log a HTTP request upon error?
>
> I am currently using a BeanShell Listener to log the ResponseData if not
> successful.
>
> if (!sampleResult.isSuccessful()) {
> log.error(sampleResult.getResponseDataAsString());
> }
> }
>
> But not sure how to log the HTTP request which caused this error.
>
> Many Thanks
>
> Paul
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>