Log full request / response in RestSharp

11,998 views
Skip to first unread message

gary lucas

unread,
Sep 10, 2012, 1:50:51 PM9/10/12
to rest...@googlegroups.com
I've got a client that I'm having issues with, I would like to log the full Request / Response from each RestSharp.

I'm not seeing anything exposed in the API, does anyone have any examples?

Gary

John Sheehan

unread,
Sep 10, 2012, 6:02:03 PM9/10/12
to rest...@googlegroups.com
i'd user fiddler

lucas...@gmail.com

unread,
Sep 10, 2012, 6:04:24 PM9/10/12
to rest...@googlegroups.com

I am...  in dev.  I need to log production...  

On Sep 10, 2012 3:02 PM, "John Sheehan" <johns...@gmail.com> wrote:
i'd user fiddler

John Sheehan

unread,
Sep 10, 2012, 6:07:28 PM9/10/12
to rest...@googlegroups.com

gary lucas

unread,
Sep 10, 2012, 6:52:11 PM9/10/12
to rest...@googlegroups.com
That's what I had just started looking at.

I was hoping for something in RestSharp, that would seem sane to me but this will work too.

G

On Monday, 10 September 2012 15:07:30 UTC-7, John Sheehan wrote:
http://msdn.microsoft.com/en-us/library/ty48b824.aspx

Andrew Young

unread,
Sep 10, 2012, 4:07:57 PM9/10/12
to rest...@googlegroups.com
RestSharp has no mechanism to log what goes over the wire. Use WireShark or other similar network monitoring app.

lucas...@gmail.com

unread,
Sep 14, 2012, 4:08:46 PM9/14/12
to rest...@googlegroups.com
I ended up configuring System.Diagnostics to trace System.Net

You can't (Well I can't and you shouldn't) run wireshark or Fiddler like tools in production. 

Gary Lucas

Kevin Croke

unread,
Oct 9, 2012, 11:02:29 AM10/9/12
to rest...@googlegroups.com
I only want to log certain RestSharp requests. It would be great if, upon execution, an event was raised with the full request and response.

Gary, do you have any suggestions on capturing only certain interactions?

Thanks,
Kevin

lucas...@gmail.com

unread,
Oct 9, 2012, 11:06:29 AM10/9/12
to rest...@googlegroups.com
I personally don't know.

We turned on tracing and figured out the problem before getting to production (Business misconfiguration).

If I have more time I may try to build a patch that will allow a reasonable level of logging (Full Request / Full Response). 

If that ever gets done than whatever logging suite you are using should be configurable to log based on whatever conditions you're looking for.

I wouldn't expect to see that available in the next few months as we're really busy with other initiatives unrelated to RestSharp.

G

John Sheehan

unread,
Oct 10, 2012, 1:56:42 AM10/10/12
to rest...@googlegroups.com
the full request/response are in RestRequest and RestResponse. How
about just serializing those to JSON or something?
Reply all
Reply to author
Forward
0 new messages