funcool

A channel for discussing and asking questions about Funcool libraries https://github.com/funcool/
2015-11-02T13:09:06.000033Z

@niwinz: ^

niwinz 2015-11-02T14:18:03.000034Z

@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)]]))

niwinz 2015-11-02T14:18:20.000035Z

Sorry for my late response, i was so busy that days

mitchelkuijpers 2015-11-02T14:18:22.000036Z

I already fixed it

mitchelkuijpers 2015-11-02T14:18:24.000037Z

no problem

mitchelkuijpers 2015-11-02T14:18:37.000038Z

that was literally what I did 😛

niwinz 2015-11-02T14:18:48.000039Z

nice!

mitchelkuijpers 2015-11-02T14:19:07.000040Z

`

mitchelkuijpers 2015-11-02T14:19:11.000041Z

(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)))))

mitchelkuijpers 2015-11-02T14:19:16.000042Z

I wanted other information though

niwinz 2015-11-02T14:20:45.000043Z

Nice! I think that would be awesome have something like that in catacumba in a more clojure friendly way..

niwinz 2015-11-02T14:20:50.000044Z

I open an issue for it 😉

mitchelkuijpers 2015-11-02T14:22:56.000045Z

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

mitchelkuijpers 2015-11-02T14:23:20.000046Z

Thanx @niwinz

niwinz 2015-11-02T14:25:12.000047Z

Thanks you for notice me about that!

mitchelkuijpers 2015-11-02T14:42:01.000049Z

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

niwinz 2015-11-02T14:46:03.000050Z

Nice to know that!

niwinz 2015-11-02T14:46:20.000051Z

I did't know that you are using cats

niwinz 2015-11-02T14:46:34.000052Z

tell me more about your experience!!

niwinz 2015-11-02T14:47:29.000053Z

Maybe you can write a blog post about that! 😛

mitchelkuijpers 2015-11-02T15:17:55.000054Z

I will do that sir