#4 Application logging hangs when Nagios unavailable

open
nobody
None
5
2011-07-06
2011-07-06
hnh
No

Hi,

In the event of the Nagios server being down the application hangs while trying to log an event using the log4j Nagios appender. Is this an expected behavior or my configuration is missing something. Here is the log4j.properties:

log4j.rootLogger=DEBUG,NAGIOS

log4j.appender.NAGIOS=org.apache.log4j.nagios.NagiosAppender
log4j.appender.NAGIOS.Host=dc2vplnag01.rbauction.net
log4j.appender.NAGIOS.Port=5667

log4j.appender.NAGIOS.ConfigFile=send_nsca.cfg

log4j.appender.NAGIOS.ServiceNameDefault=nscasvcname

log4j.appender.NAGIOS.UseMDCHostName=true
log4j.appender.NAGIOS.MDCHostNameKey=nagios_host_name
log4j.appender.NAGIOS.InitializeMDCHostNameValue=virtualhost

log4j.appender.NAGIOS.useShortHostName=true
log4j.appender.NAGIOS.MDCCanonicalHostNameKey=nagios_canonical_hostname

log4j.appender.NAGIOS.Log4j_Level_DEBUG=NAGIOS_UNKNOWN
log4j.appender.NAGIOS.Log4j_Level_INFO=NAGIOS_OK
log4j.appender.NAGIOS.Log4j_Level_WARN=NAGIOS_WARN
log4j.appender.NAGIOS.Log4j_Level_ERROR=NAGIOS_CRITICAL
log4j.appender.NAGIOS.Log4j_Level_FATAL=NAGIOS_CRITICAL

log4j.appender.NAGIOS.layout=org.apache.log4j.PatternLayout
log4j.appender.NAGIOS.layout.ConversionPattern=%X{nagios_canonical_hostname}: %m%n

Discussion