Good morning! I'm using structured logging in my app which has logging output configured by logback and the consuming service wants JSON. I've managed to get the logstash encoder to produce pretty good output but the message (which I've already formatted as a JSON string) is being wrapped in a string. What I really want is the message to contain the nested JSON instead of wrapping it in a string. Is this possible and if so, do you mind sharing a working example?
#cambium solves this problem using a codec - you may want to look at it for inspiration: https://cambium-clojure.github.io
Thanks for the suggestion Shantanu. I found a very simple solution which is working perfectly. I use the default encoder and format the pattern with JSON elements like so:
{"timestamp": "%d{yyyy-MM-dd'T'HH:mm:ssXXX}", "level": "%level", "event": %msg}%n
Java logging is such a mess.
Is there a way to produce a lazy sequence that implements CollFold in order to permit compute-heavy parallel execution over partitions of a lazy input source? I'm trying to think about transducers and reducers in the context specifically of producing a parallel execution of a fold over a monoid where the input is too large to hold in memory but the monoidal add function is computationally expensive enough as to warrant parallel execution.
I haven't used https://github.com/aphyr/tesser, but it may be close to what you're describing.
I have also used https://github.com/clj-commons/claypoole for controlled parallelism of larger-than-memory compute-intensive data processing, and it works well for this, and also has a namespace with lazy versions of its API. I don't know about whether it implements CollFold, however.
tesser looks great!
there is also obviously, once you break out of clojure, spliterator and standard java streams. you can make an implementation of spliterator and make use of parallel streams
Yes, i was aware of this, but I don't want to java 😂
i mean, clojure did just add stream interop. might as well use it once in a blue moon
Hey there, I wonder if any Clojurian is working for Qlik in Ottawa