> 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 I<syslogger.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




Reply via email to