Hi everyone,

While deploying log4j in our application we noticed that the SyslogAppender was resolving our SyslogHost value once upon construction and then caching that value until the JVM was restarted. We occasionally have to change the DNS resolution of our syslog server and would prefer not to have to restart our applications each time this occurs.

Attached is a patch that adds a new parameter for the SyslogAppender called "ResolveOnce". This parameter defaults to true (retaining existing behavior) but allows you to disable this cache by setting the parameter to false. With ResolveOnce=false the appender will ask the JVM to resolve the SyslogHost each time a message is sent. The JVM itself will cache the DNS resolution internally using its own rules (generally 30 seconds under a 1.6 JDK on Windows). I feel its important to keep this as optional functionality as in high-load situations its probably beneficial to keep the existing caching behaviour.

Any questions or comments, let me know.

Regards,
Mark Wallis
[email protected]

Attachment: syslog_dns_cache.patch
Description: Binary data



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to