[Spread-users] send text to spread group from command line?

George Schlossnagle george at omniti.com
Tue Aug 21 15:24:39 EDT 2001


> Ok, that changed fixed the startup error, but still a couple of
> problems:
>
> 1) All of the logs are being sent to the first group assigned in the
> httpd.conf file. So in this example:
>
> <VirtualHost foo>
>         CustomLog "|/usr/local/bin/sp_client -g foo_access_log -s 4803"
> combined
>         ErrorLog "|/usr/local/bin/sp_client -g foo_error_log -s 4803"
> </VirtualHost>
>
> <VirtualHost bar>
>         CustomLog "|/usr/local/bin/sp_client -g bar_access_log -s 4803"
> combined
>         ErrorLog "|/usr/local/bin/sp_client -g bar_error_log -s 4803"
> </VirtualHost>
>
> all four logs (custom and error) are being sent to the "foo_access_log"
> group. (?)
>

Sounds like an apache problem.  :)

>
> 2) When I start apache, each sp_client setting starts its own process:
>
>     root  7944  7943  0 13:38:05 ?        0:00
> /usr/local/etc/apache/bin/sp_client -g default_access_log -s 4803
>     root  7940  7939  0 13:38:04 ?        0:00
> /usr/local/etc/apache/bin/sp_client -g default_access_log -s 4803
>     root  7942  7941  0 13:38:04 ?        0:00
> /usr/local/etc/apache/bin/sp_client -g getz-web_error_log -s 4803
>     root  7945  7759  0 13:38:05 ?        0:00 /bin/sh -c
> /usr/local/etc/apache/bin/sp_client -g getz-web_access_log -s 4803
>     root  7946  7945  0 13:38:05 ?        0:00
> /usr/local/etc/apache/bin/sp_client -g getz-web_access_log -s 4803
>     root  7939  7759  0 13:38:04 ?        0:00 /bin/sh -c
> /usr/local/etc/apache/bin/sp_client -g default_access_log -s 4803
>     root  7658     1  0 13:38:00 pts/3    0:00
> /usr/local/etc/apache/bin/sp_client -g default_access_log -s 4803
>     root  7943  7759  0 13:38:05 ?        0:00 /bin/sh -c
> /usr/local/etc/apache/bin/sp_client -g default_access_log -s 4803
>     root  7941  7759  0 13:38:04 ?        0:00 /bin/sh -c
> /usr/local/etc/apache/bin/sp_client -g getz-web_error_log -s 4803
>
> This doesn't look too scalable. We'd like to see one process for
> CustomLog and one for ErrorLog, no matter how many virtual hosts.

This is why you should use mod_log_spread and not this method for CustomLog
and modify apache to allow direct error logging to spread.

> Now
> the CustomLog we have two options: use mod_log_spread to handle the log
> spreading (which we'll probably do), or put %V in the log file format
> and setup sp_client to spread to different groups depending on the
> virtual host name imbedded in the log message. ErrorLog is different
> though, we cannot just put %V into the error log without hacking apache.
> What is the best thing to do?

Hack apache or hire someone to hack apache.  And write you
congressman/friendly-neighborhood-apache2-devel-list and ask them to add API
hooks for custom error logging handles.

> If we let there be separate processes for
> each error log, will this eat up file descriptors, defeating one
> important reason for using spread?

This is the exact reason that mod_log_spread was written as an apache module
and not simply suplied as a sp_client type program.  Logging through pipe
transports is not scalable.









More information about the Spread-users mailing list