The CloudFoundry recommended way to collect HTTP access logs is to have apps dump them on stdout, in order for the loggregator to collect them.
See https://docs.google.com/document/d/1zTbS9f6s1Y8WYMhJv5lu6G1bf1ktXA-y-itc3ZOhVAA/edit?disco=AAAAAGhrT_w# for more details.
Current httd-logging.conf is:
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access_log" common
</IfModule>
It would be great to have the cf-php-apache-buildpack configure apache to dump access logs to stdout, with a prefix added on each line in order to distinguish these logs from app-generated logs.
Suggesting to add the prefix "s=access" for a concise short-cut for source=apache_access_logs
In terms of implementation, it is not clear whether standard apache config is able to generate logs on stdout, see http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#customlog may be though piped streams ?
This php heroku buildpack was instead tailing the access file on disk, see http://labs.enru.co.uk/phponheroku/#17 However, this might lack some additional logrotate to avoid filling up the disk ?
The same holds for error logs which could be output to stderr with the "s=apache_err" prefix