Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a circuit-breaking behavior #81

Open
lukas-lansky opened this issue Nov 7, 2016 · 5 comments
Open

Add a circuit-breaking behavior #81

lukas-lansky opened this issue Nov 7, 2016 · 5 comments

Comments

@lukas-lansky
Copy link

We fight issues with transient failures of our ES setup. Unfortunately, when our ES node is not working properly, log4net ES appender slows down the application radically although logging is definitely not a concern important enough for this slowdown to occur. It would be very useful if the appender could be configured in a circuit breaking fashion so that after a few long waits, it would give up for some time on trying to log.

@jptoto
Copy link
Collaborator

jptoto commented Nov 7, 2016

@lukas-lansky Unfortunately the blocker is with the log4net lib. All calls to log4net are blocking and are not run on a background thread. I'll check again to see if there is something I can do about this from the appender side of things but it may be a tough problem to solve. Because of this exact scenario I don't recommend using log4net.Elasticsearch in production as the application can really slow down. You could consider logging to text files and using Filebeat to forward directly to Elasticsearch or through Logstash to Elasticsearch.

@lukas-lansky
Copy link
Author

lukas-lansky commented Nov 7, 2016

Thanks for the answer. I'll see if I found time to look into this for myself. I understand that those problems are tricky, but it also seems to me that solutions to such kinds of problems are reasons why programmers choose to use logging frameworks. Circuit breaker seems like a fitting pattern to reduce amount of blocking caused by malfunctioning counterparty to more reasonable levels -- there may be even better solutions, of course.

@Giganticus
Copy link

What about using https://github.com/cjbhaines/Log4Net.Async ?

@jptoto
Copy link
Collaborator

jptoto commented Nov 11, 2016

Wow this is interesting, I didn't know about this lib. I'm climbing out from some other priorities but I will be able to check this out shortly. Thanks for the link!

@mayurjurani
Copy link

@jptoto What about using https://github.com/urielha/log4stash ? Won't it be a non blocking behavior for logging ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants