StructLog4J1.0 : structured logging for Java apps on top of SLF4J
I just released StructLog 1.0, a library to provide support for structured logging in Java (on top of the standard SLF4J logging API, so it can be easily integrated into any application).
https://github.com/jacek99/structlog4j
Structured logging allows to create log messages that are easily machine-parseable and thus can be used for log analytics in services such as Elastic Search, the entire ELK stack, Splunk, etc.
Instead of typical, hard-to-parse messages like
Processed 23 records for customer X in module Y
(which usually required hand-coded brittle regex to extract the important parts of the data), we can move to generating log messages like:
Processed records count=23 customer=X module=Y
Instead of key/value pairs (like above), the message can also be formatted using JSON or YAML.