r/Clojure • • Nov 04 '26

Logging in Clojure today: Timbre, Telemere, mulog or tools.logging?

Clojure has more logging choices than it used to. Telemere, from the author of Timbre, is now past 1.0, and mulog is built around structured events.

So, for a new project today:

  • Timbre, Telemere, mulog, tools.logging over a Java logger, or something else?
  • If you moved from Timbre to Telemere, was it worth it?
  • Is anyone still logging plain text lines, or is it all structured events now?
38 Upvotes

7 comments sorted by

11

u/hrrld Nov 04 '26

We use telemere on all new projects now after long using timbre.

8

u/seancorfield Nov 05 '26

At work, where we've had Clojure in production for over fifteen years, we originally used clojure.tools.logging, then switched to Timbre for a while, then switched back to clojure.tools.logging and gravitated to log4j2 over time. I wanted more control over data going into logging, so I wanted access to MDC (context maps), NDC (nested context), and markers (parent/child tags), so that context information (data) could flow into New Relic and be easily searchable/filterable.

So, early last year, I created https://github.com/seancorfield/logging4j2 which lets you build context dynamically, even across threads, and now lets you add Clojure functions as "appenders" at runtime (either for LogEvent processing or for message string processing).

We've been using it heavily in production for about 18 months at this point (with New Relic, as mentioned). It gives us a nice mix of plain text lines and structured event (context) data.

1

u/cjmurrr Nov 05 '26

I've never liked log levels being the standard. INFO or WARN is a guess, made when the code is written, about how much someone will care later. An event with a name and some data lets whoever reads the logs decide that. That's a big part of why mulog appeals to me: it has no levels at all.

2

u/bostonaholic Nov 04 '26

Structured either way. Log data (a map with an event id) and let the output layer render text for humans, since grepping strings in prod gets old fast. If you're writing a library, stick to tools.logging so you don't force a backend on users. For an app, Telemere and mulog both do structured events, and Telemere is the easier move from Timbre since it's the same author.

2

u/marginTop15px Nov 05 '26

Mulog is no brainier for me. One of the best libs IMHO. Using it on every project

1

u/SimonGray Nov 05 '26

I use Telemere "just because", though I don't really make use of any of the more advanced features. It just seems like the most full-featured one.

1

u/dig1 Nov 05 '26

I’ve used log4j2 with clojure.tools.logging for years and have never had an issue. It offers a wealth of features: appenders, filters, advanced burst control, async logging and garbage-free logging for hot paths, to name a few. They may not be needed often, but when you do need them, you’ll be glad they’re there.

[1] https://logging.apache.org/log4j/2.12.x/manual/garbagefree.html