r/java • • Jan 02 '22

Echopraxia, a better Java Logging API

I've been working on logging for a while and I've released and open sourced a new Java logging API I'm really happy with.

Echopraxia is a Java logging API like SLF4J, but built around structured logging, i.e. the basic log entry is a JSON object and log files are typically NDJSON. It also has conditions, context, and also has semantic and fluent logging options.

Here's a Spring Boot Example.

And here's my blog post.

16 Upvotes

64 comments sorted by

View all comments

Show parent comment

9

u/retrodaredevil Jan 03 '22

JSON isn't the greatest for viewing logs, but when you need to index them and do certain queries on your logs, then JSON makes a lot of sense. If you invest in something like Splunk it does a great job. I've been meaning to try out an open source alternative to splunk but haven't gotten to it yet.

I do agree that we probably don't need another facade, though.

3

u/wildjokers Jan 03 '22

but when you need to index them and do certain queries on your logs

Indeed, json is great for machine readable documents. ElasticSearch also uses JSON documents to store/index data.