odin
odin copied to clipboard
Feature request: logstash logger
It would be really nice to be able to send logs to Logstash, like in e.g. https://github.com/logstash/logstash-logback-encoder. The configuration could probably start with being as simple as passing the URL to send the logs to, eventually adding things like batch size, extra constant fields, etc.
I'm talking about a TCP appender specifically, but support for both TCP and UDP would probably make sense in the longer run. fs2-io includes pretty high-level utilities for working with TCP sockets, so that could probably be used for starters.
Messages would be serialized as JSON, so this might benefit from work done in the json module of odin.
I would gladly work on this myself, but given that mount of stuff I have in progress at the moment, I don't know when I'll have the time - so leaving this here for others to possibly pick up :)
If I understand correctly, the protocol itself is rather trivial and it's just a newline delimited JSON stream sent over TCP/IP.
The biggest challenge would be to properly deal with output buffers, like having a proper ring buffer. I remember fs2 had some real troubles with appending to the large queues.
I see we have an AsyncLogger
already, which I think could keep the responsibility of batching/buffering. So then the only thing to implement would be an actual JSON over TCP logger?
Seems like it