[svn:qpsmtpd] r666 - in branches/0.3x: . plugins/logging
[email protected] Wed, 25 Oct 2006 10:07:28 -0700 (PDT)
| Newsgroups | perl.cvs.qpsmtpd |
|---|---|
| Message-ID | <[email protected]> |
Author: jpeacock Date: Wed Oct 25 10:07:27 2006 New Revision: 666 Modified: branches/0.3x/Changes branches/0.3x/plugins/logging/syslog Log: Add log socket support to syslog plugin. (Peter Eisch) Modified: branches/0.3x/Changes ============================================================================== --- branches/0.3x/Changes (original) +++ branches/0.3x/Changes Wed Oct 25 10:07:27 2006 @@ -1,4 +1,6 @@ 0.33 + Add ability to specific socket for syslog (Peter Eisch) + Do the right thing for unimplemented AUTH mechanisms (Brian Szymanski) relay_only plugin for smart relay host. (John Peacock) Modified: branches/0.3x/plugins/logging/syslog ============================================================================== --- branches/0.3x/plugins/logging/syslog (original) +++ branches/0.3x/plugins/logging/syslog Wed Oct 25 10:07:27 2006 @@ -17,7 +17,7 @@ =over -logging/syslog [loglevel l] [priority p] [ident str] [facility f] +logging/syslog [loglevel l] [priority p] [ident str] [facility f] [logsock t] For example: @@ -74,11 +74,27 @@ The syslog facility to which logged mesages will be directed. See syslog(3) for details. The default is LOG_MAIL. +=item B<logsock> + +The syslog socket where messages should be sent via syslogsock(). The valid +options are 'udp', 'tcp', 'unix', 'stream' and 'console'. Not all are +available on all systems. See Sys::Syslog for details. The default is +the above list in that order. To select specific sockets, use a comma to +separate the types. + +=over + + logsock udp,unix + logsock stream + +=back + =back =head1 AUTHOR Devin Carraway <[email protected]> +Peter Eisch <[email protected]> (logsock support) =head1 LICENSE @@ -92,7 +108,7 @@ use strict; use warnings; -use Sys::Syslog; +use Sys::Syslog qw(:DEFAULT setlogsock); sub register { my ($self, $qp, @args) = @_; @@ -133,6 +149,11 @@ $facility = $1; } + if ($args{logsock}) { + my @logopt = split(/,/, $args{logsock}); + setlogsock(@logopt); + } + unless (openlog $ident, $logopt, $facility) { warn "Error opening syslog output"; return;