Add ECS format for structured JSON encoder
Our company primarily uses ECS logging format, with some variation here and there. I wouldn't mind contributing this possible, if I can figure out exactly how the encoders work. If it's not a major lift, I think this would be a useful format to have available.
Source: https://www.elastic.co/docs/reference/ecs/logging/java/setup
Am I right to think it involves mapping the right fields like here?
https://github.com/jstachio/rainbowgum/blob/bb613872b1402b5e4ae4f3bc44416e21582bb362/rainbowgum-json/src/main/java/io/jstach/rainbowgum/json/encoder/GelfEncoder.java#L115-L124
I didn't see any other requests for this, but I'd be interested to know if anyone else would find this useful.
Am I right to think it involves mapping the right fields like here?
You are correct.
I was planning on doing it but just ran out of time. If you give it a head start with a PR I would be happy to finish it.
Part of the reason I also delayed was to see what Spring did with structured logging but after looking at that API I think what we have is more efficient and can be revisited later.