]> gitweb.fluxo.info Git - puppet-apache.git/commitdiff
Adds custom_log, custom_log_format and error_log params at apache::site
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 21 Jun 2018 16:24:52 +0000 (13:24 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 21 Jun 2018 16:24:52 +0000 (13:24 -0300)
manifests/site.pp
templates/site.erb

index 63c97c88773226dfe0c459e00689d0d76188b90c..e499ac98e10091751dca93070a867305334e8a46 100644 (file)
@@ -31,6 +31,9 @@ define apache::site(
   $canonical            = false,
   $canonical_exceptions = '',
   $hidden_service       = false,
+  $error_log            = false,
+  $custom_log           = false,
+  $custom_log_format    = 'anon',
   $custom_directives    = false,
   $allow_override       = false,
   $hosting_domain       = hiera('apache::site::domain', $::domain),
index 20546f5f0817b644e744ea885e1b7edd9f75bbd7..3bb32a2b6e31af5e6f84940be264e3af50a8850c 100644 (file)
 <% if @custom_directives != false -%>
    <%= @custom_directives %>
 <% end -%>
+<% if @custom_log != false -%>
+   CustomLog "/var/log/apache2/<%= @name %>-access.log" <%= @custom_log_format %>
+<% end -%>
+<% if @error_log != false -%>
+   ErrorLog /var/log/apache2/<%= @name %>-error.log
+<% end -%>
 <% if @allow_override != false %>
    <Directory <%= @docroot %>>
      AllowOverride <%= @allow_override %>
 <% if @custom_directives != false -%>
   <%= @custom_directives %>
 <% end -%>
+<% if @custom_log != false -%>
+   CustomLog "/var/log/apache2/<%= @name %>-access.log" <%= @custom_log_format %>
+<% end -%>
+<% if @error_log != false -%>
+   ErrorLog /var/log/apache2/<%= @name %>-error.log
+<% end -%>
 <% if @allow_override != false %>
    <Directory <%= @docroot %>>
      AllowOverride <%= @allow_override %>