Fork me on GitHub
#reitit
<
2021-08-03
>
practicalli-john06:08:51

Any recommendations on how to log each request in Reitit? Preferably with mulog Should I create my own custom middlware def? I assume adding logging to the reitit exception middleware is only going to log exceptions and not every request. (We have very little understanding of how our customers will use the new API, so would like to capture all usage). Thank you.

ikitommi10:08:09

@jr0cket I would create a new middleware and mount it outside of the router, so it catches also routing misses.

practicalli-john13:08:00

Sound good. Do you think this example ring handler would just work with reitit, or would some tweaking be required https://github.com/BrunoBonacci/mulog/blob/master/doc/ring-tracking.md

ikitommi13:08:40

sure it works, any ring-compatible middleware works with reitit. Only thing is that example doesn’t have the 3-arity version, so it would not work with ring-async

ikitommi10:08:19

pushed out [metosin/reitit "0.5.14"], with updated deps + small fixes.

Yevgeni Tsodikov07:08:23

There's an odd behavior with the latest metosin/ring-swagger-ui - the "Execute" button in the swagger ui doesn't click. I don't know if it's a local issue for me, but I don't face any issues with metosin/reitit "0.5.13"

ikitommi08:08:13

there is the try button, did you press that first? Any errors on console?

Yevgeni Tsodikov10:08:50

Yes, I did press "try" first. No errors in Chrome's console and no traffic in the "Network" dev-tools tab

Yevgeni Tsodikov10:08:43

I reproduce it with: • "Try it out" • "Execute" -> works • Update the body's json (any field) • "Execute" -> Doesn't work

Yevgeni Tsodikov10:08:29

I'll try to prepare a demo project

ikitommi10:08:09

I haven’t been hanging here much, busy last year and ~all os-extra time has gone to play with #malli, but there are other Metosinians here and BIG thanks to everyone active here helping others 🙇 🙇

clojure 5