--- /dev/null
+[general]
+state_file = /var/lib/awslogs/agent-state
+logging_config_file = /etc/awslogs/logging.conf
+use_gzip_http_content_encoding = true
--- /dev/null
+[loggers]
+keys=root,cwlogs,reader,publisher
+
+[handlers]
+keys=consoleHandler
+
+[formatters]
+keys=simpleFormatter
+
+[logger_root]
+level=WARNING
+handlers=consoleHandler
+
+[logger_cwlogs]
+level=WARNING
+handlers=consoleHandler
+qualname=cwlogs.push
+propagate=0
+
+[logger_reader]
+level=ERROR
+handlers=consoleHandler
+qualname=cwlogs.push.reader
+propagate=0
+
+[logger_publisher]
+level=WARNING
+handlers=consoleHandler
+qualname=cwlogs.push.publisher
+propagate=0
+
+[handler_consoleHandler]
+class=logging.StreamHandler
+level=INFO
+formatter=simpleFormatter
+args=(sys.stderr,)
+
+[formatter_simpleFormatter]
+format=%(asctime)s - %(name)s - %(levelname)s - %(process)d - %(threadName)s - %(message)s
--- /dev/null
+---
+- ec2_facts:
+
+- name: Install awslogs package
+ with_items:
+ - awslogs
+ yum:
+ name: "{{ item }}"
+ state: latest
+
+- name: Install awslogs templates
+ with_items:
+ - awscli.conf
+ template:
+ src: "{{ item }}.j2"
+ dest: /etc/awslogs/{{ item }}
+ mode: "0644"
+ owner: root
+ group: root
+ notify:
+ - restart awslogs
+
+- name: Install awslogs configs
+ with_items:
+ - awslogs.conf
+ - logging.conf
+ copy:
+ src: "{{ item }}"
+ dest: /etc/awslogs/{{ item }}
+ mode: "0644"
+ owner: root
+ group: root
+ notify:
+ - restart awslogs
+
+- name: enable awslogs
+ service:
+ name: awslogs
+ enabled: yes
+ notify:
+ - restart awslogs