alager has asked for the wisdom of the Perl Monks concerning the following question:

I've found that when we centralized our logs using Sys::Syslog, that errors are not logged.
Consider the following line if $RxString is not defined.
$self->log(3, $self->log_time() . " $$: client said '$RxString'");

When the Net::Server log file is an actual file then the error will be recorded into the log file. But now with Syslog, the errors are sent to the console, and not saved.

I've tried adding something like: open (STDERR, ">>stdout_stderr_log.txt");
but the errors are not being logged.

Thanks for any help you can give.
Aaron

Replies are listed 'Best First'.
Re: Net::Server and Sys:Syslog and STDERR
by almut (Canon) on Mar 12, 2010 at 19:13 UTC

    As logging to the console is the default fallback behavior when all other attempts to connect to the syslog daemon have failed, I suppose this is exactly what's happening in your case — the order of modes tried is native, tcp, udp, unix, pipe, stream, console, unless you've changed them with setlogsock().

    Unfortunately, it's hard to tell why, from here.  Are there any warnings from openlog() etc.?

      There are no errors reported on STDERR from openlog().
      I would agree with your assessment except that the rest of the messages are continuing to be logged to syslog, as they are supposed to.
      It seems, to me, like perl runtime errors are being directed to the console directly.