Dumping the full HTTP responses to a log or console

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Dumping the full HTTP responses to a log or console

n8han
Administrator
So this is neat. If you need to debug an interaction (headers, status, body, whatever) with a server, you don't necessarily need to fire up wireshark. You can just set Configgy, and consequently Dispatch, and consequently HttpClient, to the debug log level. Define a file "log.conf" in your working directory:

<log>
  level = "debug"
  console = true
</log>

(If you're using sbt, the working directory is normally the project base directory.) Then refer to this log file from your app code, or the Scala console, wherever you are debugging:

net.lag.configgy.Configgy.configure("log.conf")

And prepare to flood your console with HTTP.

Nathan