Skip to content
Snippets Groups Projects
Commit b37982ab authored by jurgenhaas's avatar jurgenhaas
Browse files

Support for custom defined Apache log format per Drupal domain

parent cf4cfb70
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,11 @@
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
{% if drupal_domain.apache_log is defined %}
{% for line in drupal_domain.apache_log %}
{{ line }}
{% endfor %}
{% else %}
LogLevel warn
{% if apache_version|default('2.4') == '2.4' %}
ErrorLogFormat "[%{u}t] [%l] [pid %P] [client\ %{X-Forwarded-For}i] %M% ,\ referer:\ %{Referer}i"
......@@ -20,6 +25,7 @@
ErrorLog {{ apacheLogDir }}/{{ drupal_domain.domain }}-error.log
CustomLog {{ apacheLogDir }}/{{ drupal_domain.domain }}-access.log combined env=!forwarded
CustomLog {{ apacheLogDir }}/{{ drupal_domain.domain }}-access.log proxy env=forwarded
{% endif %}
</VirtualHost>
<VirtualHost *:443>
......@@ -71,6 +77,11 @@
{% endfor %}
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
{% if drupal_domain.apache_log is defined %}
{% for line in drupal_domain.apache_log %}
{{ line }}
{% endfor %}
{% else %}
LogLevel warn
{% if apache_version|default('2.4') == '2.4' %}
ErrorLogFormat "[%{u}t] [%l] [pid %P] [client\ %{X-Forwarded-For}i] %M% ,\ referer:\ %{Referer}i"
......@@ -79,6 +90,7 @@
ErrorLog {{ apacheLogDir }}/{{ drupal_domain.domain }}-error.log
CustomLog {{ apacheLogDir }}/{{ drupal_domain.domain }}-access.log combined env=!forwarded
CustomLog {{ apacheLogDir }}/{{ drupal_domain.domain }}-access.log proxy env=forwarded
{% endif %}
<IfModule mod_expires.c>
ExpiresActive {% if apache_cache.active %}On{% else %}Off{% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment