[Well-Typed Blog] Real-Time Telemetry with Eventlog Live

22 Likes

We’re also planning to create a library for writing structured log messages to the eventlog

Interesting. Is there an advantage to doing this, vs. the usual logging solutions?

This is really exciting stuff! The event log is tragically underutilized.

1 Like

With the current version of Eventlog Live, anything you log using traceEvent and traceEventIO is converted into a log record with TRACE severity, because those functions don’t let you set an explicit severity and, well, it’s right there in the name. My plan is to create a tiny library that uses traceBinaryEvent and traceBinaryEventIO to write log records with a severity and the other attributes supported by the OTLP specification, which would give you a powerful logging framework in one IO-action (and one not incredibly predictable “pure” function, if you truly need it).

The upside is a powerful logging framework that is incredibly lightweight and doesn’t require you to use a monad transformer or pass around a log action. All it does is serialize a log record and write it to the event log.

The downside is you lose some of the flexibility that, e.g., libraries such as co-log give you. I’d argue, though, that Eventlog Live gives you a lot of that flexibility back, e.g., it’s perfectly capable of writing your logs to stdout or forwards them to some other application for further exploration.

11 Likes