Re: PerlWarn and syslog

2001-12-21 Thread Lance Uyehara

 On Thu, Dec 20, 2001 at 01:59:18PM -0500, Geoffrey Young wrote:
 
If you just print to STDERR you might want to look at
Apage::LogSTDERR
on CPAN.
  
   I took at look on CPAN and was unable to find this module or any
reference
   to it. Any idea if it has been merged into some other module or if it
has
   just gone away?
 
  over the years, the folks at critical path keep teasing with talk of
  releasing Apache::LogSTDERR, but I don't think anyone outside of CP
  (Doug, Brian, Paul) has actually seen it :)

 My apologies.  I never realized that it had never been released.  I'm
 volunteering to maintain it, so I'll publish it under my CPAN id
 soon..

 For now you can visit:

   http://www.modperlcookbook.org/code.html

 and pick up a copy.

Thanks for the info. I've taken the various suggestions and am going with
Errorlog | /some/perl/script.pl. Thanks to all who responded.

I really appreciate the help.
-Lance






Re: PerlWarn and syslog

2001-12-20 Thread Lance Uyehara

 On Thu, Dec 06, 2001 at 02:11:28PM -0800, Lance Uyehara wrote:
  I am using apache+mod_perl and have:
 
  ErrorLog syslog
  PerlWarn On
 
  However the warning don't come out. If I change to ErrorLog
  /var/log/logfile or something similar then the warning start appearing.
How
  do I get the warnings when syslog is used?

 I've seen various problems with Apache's built in syslog under
 mod_perl.  The solution that I've been using lately is:

 ErrorLog | logger -p local3.debug


 If you just print to STDERR you might want to look at Apage::LogSTDERR
 on CPAN.

I took at look on CPAN and was unable to find this module or any reference
to it. Any idea if it has been merged into some other module or if it has
just gone away?

Thanks,
Lance




Re: PerlWarn and syslog

2001-12-20 Thread Geoffrey Young


  If you just print to STDERR you might want to look at Apage::LogSTDERR
  on CPAN.
 
 I took at look on CPAN and was unable to find this module or any reference
 to it. Any idea if it has been merged into some other module or if it has
 just gone away?

over the years, the folks at critical path keep teasing with talk of
releasing Apache::LogSTDERR, but I don't think anyone outside of CP
(Doug, Brian, Paul) has actually seen it :)

--Geoff



Re: PerlWarn and syslog

2001-12-07 Thread Lance Uyehara

 Since this section ss probably going away, here it is:

 The syslog solution can be implemented using the following
 configuration:

LogFormat %h %l %u %t \%r\ %s %b common
CustomLog | /usr/local/apache/bin/syslogger.pl hostnameX common

 where a simple Isyslogger.pl can look like this:

syslogger.pl

#!/usr/bin/perl
use Sys::Syslog qw(:DEFAULT setlogsock);

my $hostname = shift || 'localhost';
my $priority = 'ndelay'; # open the connection immediately
my $facility = 'local0'; # one of local0..local7
my $priority = 'info';   # debug|info|notice|warning|err...

setlogsock 'unix';
openlog $hostname, $priority, $facility;
while () {
chomp;
syslog $priority, $_;
}
closelog;

[snip]
Hmm. Why is priority redefined? Seems like you'll lose your ndelay param. I
think you mean to do something like:

my $hostname = shift || 'localhost';
my $options = 'ndelay'; # open the connection immediately
my $facility = 'local0'; # one of local0..local7

my $priority = 'info';   # debug|info|notice|warning|err...
setlogsock 'unix';
openlog $hostname, $options, $facility;

while () {
chomp;
syslog $severity, $_;
}
closelog;

The problem with this solution is all logs from apache will now have the
same priority, and they were made up by me. I'd like to keep the same
priority which apache set.

Thanks for all the help so far. I appreciate the quick responses.

-Lance







PerlWarn and syslog

2001-12-06 Thread Lance Uyehara

I am using apache+mod_perl and have:

ErrorLog syslog
PerlWarn On

However the warning don't come out. If I change to ErrorLog
/var/log/logfile or something similar then the warning start appearing. How
do I get the warnings when syslog is used?

Thanks,
Lance








Re: PerlWarn and syslog

2001-12-06 Thread Paul Lindner

On Thu, Dec 06, 2001 at 02:11:28PM -0800, Lance Uyehara wrote:
 I am using apache+mod_perl and have:
 
 ErrorLog syslog
 PerlWarn On
 
 However the warning don't come out. If I change to ErrorLog
 /var/log/logfile or something similar then the warning start appearing. How
 do I get the warnings when syslog is used?

I've seen various problems with Apache's built in syslog under
mod_perl.  The solution that I've been using lately is:

ErrorLog | logger -p local3.debug


If you just print to STDERR you might want to look at Apage::LogSTDERR
on CPAN.

-- 
Paul Lindner   [EMAIL PROTECTED]| | | | |  |  |  |   |   |

mod_perl Developer's Cookbook   http://www.modperlcookbook.org
 Human Rights Declaration   http://www.unhchr.ch/udhr/index.htm



Re: PerlWarn and syslog

2001-12-06 Thread Ged Haywood

Hi there,

On Thu, 6 Dec 2001, Lance Uyehara wrote:

 ErrorLog syslog

Are you sure you want to do this?

 How do I get the warnings when syslog is used?

There are some tips in Stas Bekman's new book, not yet published
(you'll have to become a reviwer:) and you will find some help in the
guide -- http://perl.apache.org/guide/porting.html#Apache_and_syslog

73,
Ged.




Re: PerlWarn and syslog

2001-12-06 Thread Stas Bekman

Ged Haywood wrote:

 Hi there,
 
 On Thu, 6 Dec 2001, Lance Uyehara wrote:
 
 
ErrorLog syslog

 
 Are you sure you want to do this?
 
 
How do I get the warnings when syslog is used?

 
 There are some tips in Stas Bekman's new book, not yet published
 (you'll have to become a reviwer:) and you will find some help in the
 guide -- http://perl.apache.org/guide/porting.html#Apache_and_syslog


Too many people suggested that we plunge the syslog section because of 
its slowness and unreliability. You should use log_spread instead if you 
need to collect logs from many machines.

Since this section ss probably going away, here it is:

The syslog solution can be implemented using the following
configuration:

   LogFormat %h %l %u %t \%r\ %s %b common
   CustomLog | /usr/local/apache/bin/syslogger.pl hostnameX common

where a simple Isyslogger.pl can look like this:

   syslogger.pl
   
   #!/usr/bin/perl
   use Sys::Syslog qw(:DEFAULT setlogsock);

   my $hostname = shift || 'localhost';
   my $priority = 'ndelay'; # open the connection immediately
   my $facility = 'local0'; # one of local0..local7
   my $priority = 'info';   # debug|info|notice|warning|err...

   setlogsock 'unix';
   openlog $hostname, $priority, $facility;
   while () {
   chomp;
   syslog $priority, $_;
   }
   closelog;

The syslog utility needs to know the facility to work with and the
logging level. We will use Clocal0, one of the special logging
facilities reserved for local usage (eight local facilities are
available: local0 to local7). We will use the Cinfo priority level
(again one of eight possible levels: Idebug, Iinfo, Inotice,
Iwarning, Ierr, Icrit, Ialert, Iemerg).

Now make the syslog utility on the master machine (where all logs are
to be stored) log all messages coming from facility Clocal0 with
logging level Cinfo to a file of our choice. This is achieved by
editing the I/etc/syslog.conf file. For example:

   local0.info /var/log/web/access_log

All other machines forward their logs from facility Clocal0 to the
central machine, therefore on all but the master machine we add the
forwarding directive to the I/etc/syslog.conf file (assuming that
the master machine's hostname is Cmasterhost):

   local0.info @masterhost

We must restart the syslogd(8) daemon or send it the C-HUP kill
signal for the changes to take effect before the logger can be used.


_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/