hey folks! about pedestal logging, I want each request to log a "context-id" that is the same for every log in that same request. Is there a recommended way of doing this with Pedestal?
I think this is what you need: http://pedestal.io/api/0.7/io.pedestal.log.html#var-with-context
hey! thanks for the link, maybe it is but I'm unsure how to use it, is it an option that I pass to the log function?
Essentially, it sets up the SLF4J MDC. The MDC is an additional bit of data that a Logback appender (or whatever you are using) is formatting a message. Yes, that's obtuse. It's also painful, because the SLF4J MDC is in a ThreadLocal, but not one that Clojure knows about, so if you get to a different thread, you may lose the MDC. Or the MDC can leak data from one thread to another when the thread is reused.
I took a crack at this long before I was involved with Pedestal: https://github.com/AvisoNovate/logging
So I think a better solution would be an MDC supported by Pedestal that would merge with the particular log event before beeing converted to a string and passed down into SLF4J's api.
That could be added in 0.8.
Is there something I could use with the current version of pedestal? even if it involves using a different logging library with it. I tried using https://github.com/AvisoNovate/logging and it didn't work (or maybe I used it wrong)