eht16 / python-logstash-async

Python logging handler for sending log events asynchronously to Logstash.
MIT License
186 stars 51 forks source link

filebeat #44

Closed jordotech closed 5 years ago

jordotech commented 5 years ago

After experimenting with this app it dawned on me - this is what filebeat is for. Filebeat lives on the server you're shipping logs FROM and operates on an interval so it does not interfere with request times, etc.

So my question is why is it preferable to store messages in a sqlite db and async ship them as opposed to using filebeat?

eht16 commented 5 years ago

First, request times should not be affected that much as the shipping happens in a separate thread asynchronously, i.e. after the request has been handled already. Of course, we are talking about Python and its GIL but a separate thread still should be better than nothing.

About FileBeat: there are a few differences which make this package worth using:

After all, I think both approaches are valid and have their own use cases. It's your decision which fits best to your situation and requirements.

jordotech commented 5 years ago

Thank you for the detailed answer, this could go in the docs!