MarkusLaker has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to write a program that logs events on a remote machine. I'm running on Debian Jessie and, for now, logging to my local rsyslogd. The first event always gets lost, but the second is logged normally.
A colleague running the same program against other targets says that Splunk discards the first event and a Windows-based syslog watcher reports the first event as having no usable strings.
I've narrowed it down to this test code:
#!/usr/bin/perl use warnings; use strict; use v5.10; use Sys::Syslog qw/:DEFAULT setlogsock/; setlogsock({ type => 'tcp', host => 'localhost', port => 514 }) or die "Can't set syslog socket\n"; openlog 'wombat', 'ndelay', 'local0' or die "Can't open the event log\n"; syslog 'INFO', 'First wombat event'; syslog 'INFO', 'Second wombat event'; closelog or die $!;
Am I using Sys::Syslog wrongly, or does it have a bug that causes the first event to get lost?
(I know that the man page asks us -- twice -- not to run setlogsock, but there's no other clean way to log events on a remote machine, which is part of the specification of the program I'm writing.)
Many thanks.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Sys::Syslog skips the first event
by stevieb (Canon) on Jun 08, 2015 at 15:23 UTC | |
by MarkusLaker (Beadle) on Jun 10, 2015 at 15:22 UTC | |
by FreeBeerReekingMonk (Deacon) on Jun 10, 2015 at 19:13 UTC | |
by MarkusLaker (Beadle) on Jun 11, 2015 at 13:12 UTC | |
Re: Sys::Syslog skips the first event
by Anonymous Monk on Jun 08, 2015 at 15:21 UTC | |
by MarkusLaker (Beadle) on Jun 10, 2015 at 15:16 UTC |
Back to
Seekers of Perl Wisdom