[Spread-users] mod_log_spread, error_log_spread.pl
Michael Paesold
mpaesold at gmx.at
Fri Jan 18 12:48:32 EST 2002
Hi,
we are using mod_log_spread in apache and the error_log_spread.pl for error
logging. We occasionally have problems similar to those discussed here
recently.
So I had a look at the error_log_spread.pl. Well, it doesn't call recieve()
at all. Could it be possible this is causing some serious problems?
I copy the script into this mail, so do don't have to get the sources.
Thanks for any help,
Michael
#!/usr/bin/perl
######################################################################
# Logger.pl
#
# Copyright (c) 2000 George Schlossnagle. All rights reserved.
# This program is free software, you can redistribute it and/or
# modify it under the same terms as Perl itself. This software
# is provided ``as is'' and any express or implied warranties,
# including, but not limited to, the fitness for a patricular
# purpose are disclaimed. Yadda yadda yadda.
#
######################################################################
#use ExtUtils::testlib;
use Spread qw(:SP :MESS :ERROR);
use Getopt::Std;
$| = 1;
# Read in options
getopts('dg:hs:', \%opts);
$debug = $opts{d};
&usage() unless ($group = $opts{g});
$hosttoggle = $opts{h};
$spreaddaemon = ($opts{s}?$opts{s}:3333);
# Set spread connection params
#$hostname = `hostname`;
chomp ($hostname = `hostname`) ;
$args{'spread_name'} = $spreaddaemon;
$args{'private_name'} = "$$-$hostname";
$args{'priority'} = 0;
$args{'group_membership'} = 0;
# changed from 1 to 0 ...
# Connect to daemon
print "Trying to connect to spread...\n" if $debug;
($mbox, $privategroup) = Spread::connect(
\%args
);
print "$sperrno\n" unless (defined($mbox) && $debug);
#Logging loop
while(<STDIN>){
chomp;
print "MESSAGE $_\n";
if(($ret = Spread::multicast($mbox,
RELIABLE_MESS, $group, 0,
($hosttoggle?$hostname."
".$_."\n":$_."\n")))>0) {
print STDERR "Successfully multicasted $ret bytes to [$group]\n" if
$debug;
} else {
print STDERR "Failed multicast $_ to $group: $sperrno\n" if $debug;
}
}
sub usage(){
print STDERR "Usage: Logger -g group [-h] [-s daemon] [-d]\n";
exit 0;
}
--
Michael Paesold, Austria/Europe
More information about the Spread-users
mailing list