On Friday, 1 December 2017 18:18:36 UTC+5:30, [email protected] wrote: > > On Thursday, November 30, 2017 at 3:35:24 PM UTC+1, Shantanu Kumar wrote: >> >> >> I am happy to announce the availability of Cambium, an Open Source >> project for structured logging in Clojure using SLF4j and Logback. >> >> Details: https://cambium-clojure.github.io/ >> Repos: https://github.com/cambium-clojure >> > > Looks nice, thank you for sharing! I've got a number of questions: >
Thanks! My responses are inline: > 1) Is it possible to include example output for FlatJsonLayout in the > documentation? > I have updated the quickstart section with the output: https://cambium-clojure.github.io/#quickstart > 2) Given that it uses SLF4J, I guess it can also work with > java.util.logging? > SLF4j works with java.util.logging with a caveat. Cambium uses the MDC feature of SLF4j for context-logging (structured logs), which requires a logging backend with MDC support. Logback and Log4j support MDC but java.util.logging does not, so it may be challenging to get MDC to work with the latter. Ref: https://stackoverflow.com/questions/16811885/mdcmapped-diagnostic-context-support-for-juljava-util-logging > 3) How exception messages are logged: in or outside of the context? > Exceptions are logged in the context, try (cambium.core/error {:foo :bar} exception "Error happened") - it ends up under the "exception" key in the JSON map. > 4) Are clojure.lang.ExceptionInfo exceptions printed with the data map? > From what I've seen previously, only java.util.logging uses .toString() on > exception object which results in message *and* data, the rest of logging > backends use only .getMessage() for some reason, completely missing the > data from the log message. > The data is not extracted/merged into the context from clojure.lang.ExceptionInfo - you can possibly log it as (cambium.core/error {:foo :bar} ex (str ex)) to have similar effect. The message ends up under the "message" key in the JSON map. (It probably makes sense to include the ex-data as a separate attribute - I will think about it; also, suggestions welcome.) Shantanu -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
