Add log socket support to syslog plugin. (Peter Eisch)
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@666 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
413d3c38d3
commit
da93a9ca3b
2
Changes
2
Changes
@ -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)
|
||||
|
@ -17,7 +17,7 @@ configuration file:
|
||||
|
||||
=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 default is 'qpsmtpd'.
|
||||
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 <qpsmtpd@devin.com>
|
||||
Peter Eisch <peter@boku.net> (logsock support)
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
@ -92,7 +108,7 @@ Please see the LICENSE file included with qpsmtpd for details.
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Sys::Syslog;
|
||||
use Sys::Syslog qw(:DEFAULT setlogsock);
|
||||
|
||||
sub register {
|
||||
my ($self, $qp, @args) = @_;
|
||||
@ -133,6 +149,11 @@ sub register {
|
||||
$facility = $1;
|
||||
}
|
||||
|
||||
if ($args{logsock}) {
|
||||
my @logopt = split(/,/, $args{logsock});
|
||||
setlogsock(@logopt);
|
||||
}
|
||||
|
||||
unless (openlog $ident, $logopt, $facility) {
|
||||
warn "Error opening syslog output";
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user