Fork me on GitHub

Hi guys, I started learning Pedestal and I would like to log the incoming request in the interceptor I have a function

(defn home [request]
  (io.pedestal.log/debug "------->" request)
  {:status 200
   :headers {"Content-Type" "text/html"}
   :body   (selmer/render-file "home.html" {})})
but nothing is getting printed in the repl


is there a more idiomatic way for inspecting stuff in pedestal?


I’m pretty sure that call to log is wrong, but I’m on mobile and can’t check. But if you want to inspect things, I’d use the repl, def the request to a global var and go from there...

orestis16:03:54;ie=UTF-8&amp;oe=UTF-8&amp;hl=el-dk&amp;client=safari - sorry for pasting a google link, but I’m in a hurry - there’s some good stuff out there!


@g3o, If you are using default-interceptors, there’s a default request logging interceptor but it can be overridden by adding the io.pedestal.http/request-logger key to your service map. (See @orestis is correct about the logging call being incorrect. Pedestal’s logging api expects key/value pairs so you’d do something like this (log/debug :request request)


I’ll try that, thanks guys!

👍 4