Fork me on GitHub

is there any way to turn off the pedestal org.eclipse.jetty Debug messages from timbre?


I tried using com.fzakaria/slf4j-timbre and use :ns-blacklist ["org.eclipse.jetty.*" "io.pedestal.*" "com.walmartlabs.lacinia.*"] but it didn´t work

Ivar Refsdal10:10:04

What version of timbre and slf4j-timbre are you using? :ns-blacklist is deprecated? I am using :min-level like so:

{:min-level       [[#{"*"} :info]
                                       [#{"*"} :warn]]}
for passing to timbre 5.1.0 and using slf4j-timbre 0.3.20

Ivar Refsdal10:10:12

which works fine


I ran into a problem where the recent log back-classic broke, resulting in slf4j based Java code, like jetty and Kafka disregarding timbre whitelists


The solution is to remove the exclusion on logback-classic for the API, then all is well


Not sure this is same issue as you are facing


Can someone point me in the right direction. I’m trying to send a POST from my client and earlier today I did manage to send my :post field and get it to save to the database. At the moment that’s not working and i’m trying to figure out what’s going on and if this is an issue with my backend or frontend(both)?


The response is nil, I see that. But i’m confused as hell because it did indeed write to my DB earlier. Now it triggers the creation of an empty row so I at least know it’s hitting that route properly, i’m just not catching the data.

Lennart Buit05:10:50

Your log contains an exception. So presumably something goes wrong in your handler / pedestal ends up down the error functions of your interceptors

Lennart Buit05:10:25

The exception says you are calling a map (which is legit), but don’t end up passing arguments. I think that’s somewhere else (as in, not in your gist)

Lennart Buit05:10:33

(This is allowed: ({:a 1} :a), but this is not ({:a 1}))

👍 1

Hmm, I do have the project public. Oh! That ghetto hack to pass in the architect id huh?


On pedestal context we can find "content-type" "application/transit+json" Is it really transit? If it is transit, you should access :transit-params (that is nil, in this case) If is not transit, you shuold use content-type application/json You probably will solve this on the client. The server looks fine


This should fix

(defn send-message! [fields]
  (-> (js/fetch "/iots"
        #js{:method  "POST"
            :headers #js {"content-type" "application/json"}
            :body    (js/JSON.strinfigy (clj->js @fields))})
    (.then (fn [res] (.json res)))
    (.then #(.log js/console (str "response: " %)))
    (.catch #(.error js/console (str "error: " %)))))

👍 1

I have a small reagent+pedestal didactic project, with just ~300 LOC It uses JSON to communicate in the API, really similar to your setup. I'm still writing the tutorial (it is incomplete) but it serves as a reference 🙂


@U2J4FRT2T Thanks! Taking a look now… yeah i’m just now learning how to read the output and noticed I was trying to access something that doesn’t exist.


js/fetch is really interesting. I’ve never seen that before. That’s preferred over cljs-ajax?


I really like the browser API's. I (personally) don't see many value in these "magical easy ajax libraries"

👍 1

Yeah, I won’t argue that. I’m just now starting to learn JS so I know what’s actually going on. I’ll adopt this practice.


feel free to send me any questions 🙂

👍 1
Lennart Buit16:10:52

Mdn is your friend in learning browser tech (html/css/js + stdlib)

👍 1

Ok sorry, I still have some confusion. I’m able to write to the database now from my client but it still throws a 500 and complains. What am I missing there because my map definitely is getting passed in to insert-iota clojure.lang.ExceptionInfo: clojure.lang.ArityException in Interceptor :cybernest-xd.db/insert-iota - Wrong number of args (0) passed to: clojure.lang.PersistentHashMap


This error: `Wrong number of args (0) passed to: clojure.lang.PersistentHashMap db.clj` Is always result of something like (m) or (apply m []) where m is a hash-map I think that in this case, is related to the #spy/p

❤️ 2

@U2J4FRT2T wow, that absolutely was it… thank you!