tesla v0.9.0 Tesla.Middleware.DebugLogger View Source

Log full reqeust/response content

Example usage

defmodule MyClient do
  use Tesla

  plug Tesla.Middleware.DebugLogger
end

Logger output

2017-09-30 13:41:56.281 [debug] > POST https://httpbin.org/post
2017-09-30 13:41:56.281 [debug]
2017-09-30 13:41:56.281 [debug] > a=3
2017-09-30 13:41:56.432 [debug]
2017-09-30 13:41:56.432 [debug] < HTTP/1.1 200
2017-09-30 13:41:56.432 [debug] < access-control-allow-credentials: true
2017-09-30 13:41:56.432 [debug] < access-control-allow-origin: *
2017-09-30 13:41:56.432 [debug] < connection: keep-alive
2017-09-30 13:41:56.432 [debug] < content-length: 280
2017-09-30 13:41:56.432 [debug] < content-type: application/json
2017-09-30 13:41:56.432 [debug] < date: Sat, 30 Sep 2017 11:41:55 GMT
2017-09-30 13:41:56.432 [debug] < server: meinheld/0.6.1
2017-09-30 13:41:56.432 [debug] < via: 1.1 vegur
2017-09-30 13:41:56.432 [debug] < x-powered-by: Flask
2017-09-30 13:41:56.432 [debug] < x-processed-time: 0.0011260509491
2017-09-30 13:41:56.432 [debug]
2017-09-30 13:41:56.432 [debug] > {
  "args": {},
  "data": "a=3",
  "files": {},
  "form": {},
  "headers": {
    "Connection": "close",
    "Content-Length": "3",
    "Content-Type": "",
    "Host": "httpbin.org"
  },
  "json": null,
  "origin": "0.0.0.0",
  "url": "https://httpbin.org/post"
}

Link to this section Summary

Link to this section Functions

Callback implementation for Tesla.Middleware.call/3.