jschniper / gelf_logger

An Elixir Logger backend for GELF
MIT License
29 stars 27 forks source link

Don't lookup the hostname during initialisation #8

Closed jstepien closed 7 years ago

jstepien commented 7 years ago

This commit defers DNS lookups until submission of UDP packets. It removes :inet.gethostbyname from the configure function and passes the unresolved hostname to :get_udp.send as a char list. This allows gelf_logger to react to DNS changes at runtime. Prior to this commit an IP address change of the destination host would cause us to lose all subsequent log lines.

Fixes #7 by allowing gelf_logger to be started despite the target hostname being unresolvable.

Let me know what you think 😀. Thanks a lot for the awesome lib!

jschniper commented 7 years ago

I'm honestly a little ashamed that I hadn't noticed that before. Thank you for the pull request!