New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactorized the code #9
Conversation
src/AccessLog.php
Outdated
*/ | ||
private function getFormat() | ||
{ | ||
$message = $this->vhost ? '%v' : '%h'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vhost info should not substitute the IP info, it should prepend it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the example in https://httpd.apache.org/docs/2.4/logs.html#accesslog (Section "Virtual Hosts") contains the following format:
LogFormat "%v %l %u %t \"%r\" %>s %b" comonvhost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I'm interested in vhost_combined
format defined in debian package: https://anonscm.debian.org/cgit/pkg-apache/apache2.git/tree/debian/config-dir/apache2.conf?h=jessie#n206
[WIP] Define commonly used log formats
This change uses
strtr
insteadsprintf
to generate the messages, providing more flexibility to customize the output format.It also fixes some bugs like append the uri's query to the path or replace
%h
value (ip) by%v
(virtual host) instead prepend it.