logback icon indicating copy to clipboard operation
logback copied to clipboard

Resolve DNS (respecting InetAddress caching rules) for each UDP packet.

Open dstockton opened this issue 9 years ago • 12 comments

When using the SyslogOutputStream (noting that it's also used by LogstashSocketAppender) the InetAddress DNS lookup result is cached at initialization. The resulting effect is that if the upstream syslog host changes IP (such as in a cloud environment where the instance is relaunched) logs are silently dropped (as they're sent using UDP) until logging is re-initialized (typically a service restart). Additionally, it blocks horizontal scaling of upstream syslog servers using a DNS round robin approach.

The submitted change uses the standard InetAddress DNS caching mechanism and so (DNS configuration dependent, but by default) does not result in a large overhead on DNS servers or the local JVM.

dstockton avatar Jun 15 '15 08:06 dstockton

@tony19 Thanks for reviewing. I've made the fix (sorry it took so long, I was on holiday).

dstockton avatar Jun 15 '15 08:06 dstockton

@dstockton, Instead of merging master to your branch, please rebase your two changes onto the tip of master, and squash your commits.

tony19 avatar Jun 21 '15 19:06 tony19

@tony19 I believe this is done now. Would you be able to merge?

dstockton avatar Jul 02 '15 09:07 dstockton

@ceki It looks like Tony has been very busy. I think this PR is a small and useful change. Would you be willing to merge it? Or suggest another Git repo owner for me to contact? Many thanks

dstockton avatar Aug 13 '15 11:08 dstockton

@dstockton I have asked Tony to suspend merges. I will look into this pull request ASAP. If I somehow overlook this request, do not hesitate to remind me.

ceki avatar Aug 13 '15 12:08 ceki

@ceki Just following up with you about reviewing this PR. Many thanks!

dstockton avatar Aug 19 '15 10:08 dstockton

hi, is there any progress on merging this?

marcinjedyk-msm avatar Oct 16 '15 08:10 marcinjedyk-msm

I am currently working on SLF4J related pull requests. Will be looking at logback related requests in the coming days.

ceki avatar Oct 16 '15 10:10 ceki

I hate to "me too" / +1 bug tickets but this has been a pretty big deal for us, I was about to implement something similar and was pleased to see someone beat me to it. Thanks

treyhyde avatar Nov 04 '15 01:11 treyhyde

@treyhyde Thanks for the mention. I've ended up writing an additional OutputStream & Appender class that we load in from another JAR that do this as it's taken too long for us to wait. Assuming the merges are still not coming on this repo, you could also do the same quite quickly by just duplicating & changing the class names if you can't wait. Good luck!

dstockton avatar Nov 04 '15 10:11 dstockton

Hello been wondering is there any progress on merging this or provider alternate resolution?

MSMSalim avatar Jun 28 '19 11:06 MSMSalim

@MSMSalim good luck reviving a PR from 4 years ago!! :)

dstockton avatar Jun 28 '19 11:06 dstockton