<%= '# NOTE: This config file was generated by chef and will be overwritten at the next chef run!' %>
[general]
# Path to the AWSLogs agent's state file. Agent uses this file to maintain
# client side state across its executions.
state_file = <%= "#{node['cwlogs']['state_file_dir']}/#{node['cwlogs']['state_file_name']}" %>
<% if node['cwlogs']['logging_config_file'] %>
logging_config_file = <%= node['cwlogs']['logging_config_file'] %>
<% end %>
<% if node['cwlogs']['use_gzip_http_content_encoding'] %>
use_gzip_http_content_encoding = <%= node['cwlogs']['use_gzip_http_content_encoding'] %>
<% end %>


## Each log file is defined in its own section. The section name doesn't
## matter as long as its unique within this file.
#
#[kern.log]
## Path of log file for the agent to monitor and upload.
#file = /var/log/kern.log
## Name of the destination log group.
#log_group_name = kern.log
## Name of the destination log stream.
#log_stream_name = {instance_id}
## Format specifier for timestamp parsing.
#datetime_format = %b %d %H:%M:%S

<% if node['cwlogs']['logfiles'] %>
<% node['cwlogs']['logfiles'].each do |section_name, section_config| %>

<%= '[' + section_name + ']' %>
<% section_config.each do |key,val| %>
<%= key %> = <%= val %>
<% end %>
<% end %>
<% end %>
