How do I see the whole HTTP request in Rails

后端 未结 4 731
北海茫月
北海茫月 2020-12-29 04:20

I have a Rails application but after some time of development/debugging I realized that it would be very helpful to be able to see the whole HTTP request in the logfiles - l

4条回答
  •  滥情空心
    2020-12-29 04:59

    I've initially used the code snippet by @AlexChaffee, but I've since switched to using mitmproxy, a specialized HTTP proxy that records the requests and responses passing through it.

    This is obviously only helpful for development scenarios when you control the applications making the requests. You might be able to achieve similar results with a reverse proxy for production applications (the advantage being that you don't have to touch the Rails application itself for this), but I haven't looked into this.

提交回复
热议问题