This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-02
Channels
- # admin-announcements (15)
- # aws (35)
- # beginners (6)
- # boot (183)
- # cider (51)
- # clara (17)
- # cljs-dev (32)
- # clojure (67)
- # clojure-dev (7)
- # clojure-india (1)
- # clojure-japan (3)
- # clojure-norway (1)
- # clojure-russia (26)
- # clojurescript (85)
- # clojurex (4)
- # community-development (1)
- # cursive (18)
- # data-science (1)
- # datomic (46)
- # devcards (29)
- # events (7)
- # funcool (21)
- # hoplon (10)
- # ldnclj (2)
- # lein-figwheel (16)
- # off-topic (60)
- # om (37)
- # onyx (8)
- # re-frame (23)
- # reagent (5)
- # yada (6)
@mitchelkuijpers: at this moment is not posibile do it directly in catacumba but I think you can use java interop just for that:
(import 'ratpack.handling.RequestLogger)
(def routes (ct/routes [[:any (RequestLogger/ncsa)]]))
I already fixed it
no problem
that was literally what I did 😛
(defn- log-request [^RequestOutcome outcome]
(let [request ^Request (.getRequest outcome)
duration ^Duration (.getDuration outcome)
response ^SentResponse (.getResponse outcome)
status ^Status (.getStatus response)]
(log/info (format "%sms \"%s %s %s\" %s"
(.toMillis duration)
(.getMethod request)
(.getUri request)
(.getProtocol request)
(.getCode status)))))
I wanted other information though
Nice! I think that would be awesome have something like that in catacumba in a more clojure friendly way..
One thing I noticed that if I use this with the component based approach it seems to be related to the order if the the logger get’s called for routes
We are running in production now for a few weeks already, works like charm. combining the handlers with cats and manifold deferreds is seriously powerfull
I will do that sir