Hi!
On Sat, Aug 16, 2014 at 12:25:18AM -0400, Charlie Brady wrote:
> I'd like to collect stdout and stderr separately. I could use this, for
> instance, with web servers, to collect access logs from stdout and error
> logs from stderr. Why has nobody done this? Or did I just not notice?
When you need more than one log stream - configure your app to write logs
into fifo files and run separate log service for each file. Here is
example of my apache setup:
vhosts.d/00_default_ssl_vhost.conf: ErrorLog /var/log/apache2/ssl_error_log
vhosts.d/00_default_ssl_vhost.conf: TransferLog /var/log/apache2/ssl_access_log
vhosts.d/00_default_ssl_vhost.conf: CustomLog /var/log/apache2/ssl_request_log …
modules.d/00_default_settings.conf: ErrorLog /var/log/apache2/error_log
modules.d/00_mod_log_config.conf: CustomLog /var/log/apache2/access_log …
# ls -l /var/log/apache2/
total 80
drwxr-s--- 2 log root 61440 Aug 16 01:26 access
prw------- 1 root root 0 Aug 16 09:27 access_log
drwxr-s--- 2 log root 4096 Aug 13 21:22 error
prw------- 1 root root 0 Aug 16 09:27 error_log
drwxr-s--- 2 log root 4096 Feb 14 2012 ssl_access
prw------- 1 root root 0 Apr 4 2008 ssl_access_log
drwxr-s--- 2 log root 4096 Feb 14 2012 ssl_error
prw------- 1 root root 0 Apr 4 2008 ssl_error_log
drwxr-s--- 2 log root 4096 Feb 14 2012 ssl_request
prw------- 1 root root 0 Apr 4 2008 ssl_request_log
Next, I have these services, each with only ./run (without ./log/run):
/var/service/apache2
/var/service/apache2-log-access
/var/service/apache2-log-error
/var/service/apache2-log-ssl-access
/var/service/apache2-log-ssl-error
/var/service/apache2-log-ssl-request
./run files for all apache2-log-* services are similar, example:
#!/bin/sh
exec chpst -u log svlogd /var/log/apache2/access/ <>/var/log/apache2/access_log
--
WBR, Alex.
Received on Sat Aug 16 2014 - 06:32:33 UTC