@niwinz: ^
@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)]]))
Sorry for my late response, i was so busy that days
I already fixed it
no problem
that was literally what I did 😛
nice!
`
(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..
I open an issue for it 😉
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
Thanx @niwinz
Thanks you for notice me about that!
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
Nice to know that!
I did't know that you are using cats
tell me more about your experience!!
Maybe you can write a blog post about that! 😛
I will do that sir