Konubinix' opinionated web of thoughts

Logfmt

Fleeting

Each line consists of a single level of key/value pairs which are densely packed together compared to other well-known structured formats like JSON

https://www.brandur.org/logfmt

calling this style of structured logging “logfmt”

https://www.brandur.org/logfmt

standard for log emission across internal components

https://www.brandur.org/logfmt

with a bit of practice (and ideally, colorized output), it’s pretty easy for a human being to read logfmt

https://www.brandur.org/logfmt

I’d recommend using the approach seen in logrus and including a human readable message with every log line

I’d recommend using the approach seen in logrus and including a human readable message with every log line

level=info msg=“Stopping all fetchers” tag=stopping_fetchers id=ConsumerFetcherManager-1382721708341 module=kafka.consumer.ConsumerFetcherManager

In

development, a log output formatter can then give the msg field special treatment by displaying it in way that a human can easily read (along with other special fields like level):

info | Stopping all fetchers module=kafka.consumer.ConsumerFetcherManager info | Performing log compaction module=kafka.compacter.LogCompactionManager info | Performing garbage collection module=kafka.cleaner.GarbageCollectionManager info | Starting all fetchers module=kafka.consumer.ConsumerFetcherManager

https://www.brandur.org/logfmt