1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
<% @_access_logs.each do |log| -%>
<% env ||= "env=#{log['env']}" if log['env'] -%>
<% env ||= '' -%>
<% format ||= "\"#{log['format']}\"" if log['format'] -%>
<% format ||= 'combined' -%>
<% if log['file'] -%>
<% if log['file'].chars.first == '/' -%>
<% destination = "#{log['file']}" -%>
<% else -%>
<% destination = "#{@logroot}/#{log['file']}" -%>
<% end -%>
<% elsif log['syslog'] -%>
<% destination = log['syslog'] -%>
<% elsif log['pipe'] -%>
<% destination = log['pipe'] -%>
<% else -%>
<% destination ||= "#{@logroot}/#{@filename}_access_ssl.log" if @ssl -%>
<% destination ||= "#{@logroot}/#{@filename}_access.log" -%>
<% end -%>
CustomLog "<%= destination %>" <%= format %> <%= env %>
<% end -%>
|