gelfj
gelfj copied to clipboard
Server hostname is cached for the duration of the process requiring restarts to refresh
It looks like both GelfUDPSender
and GelfTCPSender
caches the hostnames of the graylog server for the duration of the process, which makes it unnecessary hard to fail-over / replace the server without restarting all the clients so they can resolve the hostname again.
Please correct me if I've read the source code wrong.
Is there any reason why this cannot be done upon every reconnect on the GelfTCPSender
and periodically (i.e default every 10 min, configurable via a new setting) for the GelfUDPSender
?
You are right. Appender only resolves hostname during instantiation. Resolving hostname every send might be very time consuming.
I think configurable cache should be best option.
Unless system property networkaddress.cache.ttl
is set, it will not make a difference as the JDK will cache DNS lookups forever anyway
Hi
@t0xa "Resolving hostname every send might be very time consuming." why? most of the time is going to be fetched from cache (depends on the ttl value) and if you don't set the networkaddress.cache.ttl in the java.security file is always going to be fetched from cache (default setting in the JVM)
Regards