This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-24
Channels
- # announcements (10)
- # aws-lambda (9)
- # babashka (14)
- # beginners (166)
- # calva (63)
- # chlorine-clover (4)
- # cider (40)
- # cljs-dev (4)
- # clojure (182)
- # clojure-europe (18)
- # clojure-italy (5)
- # clojure-nl (5)
- # clojure-spec (17)
- # clojure-uk (55)
- # clojurescript (11)
- # core-async (12)
- # cursive (23)
- # datascript (5)
- # datomic (19)
- # emacs (4)
- # fulcro (46)
- # graalvm (2)
- # hoplon (2)
- # joker (3)
- # juxt (1)
- # keechma (2)
- # leiningen (20)
- # malli (1)
- # meander (7)
- # nrepl (1)
- # off-topic (72)
- # pedestal (6)
- # re-frame (15)
- # reitit (7)
- # shadow-cljs (34)
- # sql (14)
- # testing (14)
- # tools-deps (11)
- # tree-sitter (1)
- # vim (14)
- # xtdb (19)
- # yada (3)
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 replI’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...
https://www.google.dk/search?q=clojure+debugging+with+def&ie=UTF-8&oe=UTF-8&hl=el-dk&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 http://pedestal.io/reference/default-interceptors)
@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)