code modified for rsyslogd