eht16 / python-logstash-async

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

Memory cache with timeout #11

Closed loganasherjones closed 7 years ago

loganasherjones commented 7 years ago

Hey! First, thanks so much for this library.

I would like to implement a backend that does not persist to disk. I'm thinking of doing this by adding a TTL on the messages along with some new config values. If I did this and submitted a PR, would you be interested in accepting it?

eht16 commented 7 years ago

Sure, sounds interesting.

Initially, the documentation had a sample config for a Sqlite in-memory database (:memory) for that purpose. Though, here a Sqlite database doesn't make any sense as it works only with the exactly same instance of the Sqlite database connection which is not really possible.

Your approach would need to handle this as well. In the worst case, it is necessary to pass an instance around. Though I'd like to avoid this if possible. Maybe some sort of Singleton would suffice.

Anyway, just go ahead and if I can help in any way, just ask.

loganasherjones commented 7 years ago

Hey @eht16, not sure if you saw the PR or not. Let me know if you have any feedback!

eht16 commented 7 years ago

I noticed it but didn't get to have a closer look yrt, will do soon.

loganasherjones commented 7 years ago

No worries. Let me know if there's anything else I can do!

eht16 commented 7 years ago

This should be solved after we have merged #12.