Merged in DCD-930-audit-logs-to-cloudwatch (pull request #82)

DCD-930: Consolidate log definitions and forward audit logs to cloudwatch.

Approved-by: Adam Brokes <abrokes@atlassian.com>
Approved-by: Ben Partridge <bpartridge@atlassian.com>
This commit is contained in:
Steve Smith
2020-02-05 03:17:22 +00:00
3 changed files with 24 additions and 22 deletions

View File

@@ -34,20 +34,27 @@ atl_product_installation_versioned: "{{ atl_product_installation_base }}/{{ atl_
atl_product_installation_current: "{{ atl_product_installation_base }}/current" atl_product_installation_current: "{{ atl_product_installation_base }}/current"
atl_installer_temp: "{{ atl_installation_base }}/tmp" atl_installer_temp: "{{ atl_installation_base }}/tmp"
atl_product_log_locations: atl_product_logs_default: &logs_default
- path: "{{ atl_product_installation_current }}/logs/*"
type: product
- path: "{{ atl_product_home }}/logs/*"
type: product
- path: "{{ atl_product_home }}/logs/audit/*"
type: audit
- path: "/var/log/ansible-bootstrap.log"
type: provisioning
- path: "/var/log/cfn-*.log"
type: provisioning
atl_product_logs:
confluence: confluence:
- "{{ atl_product_installation_current }}/logs" *logs_default
- "{{ atl_product_home }}/logs"
jira: jira:
- "{{ atl_product_installation_current }}/logs" *logs_default
- "{{ atl_product_home }}/log"
stash: stash:
- "{{ atl_product_home }}/log" *logs_default
crowd: [] crowd: []
atl_provisioner_log_locations:
- "/var/log/ansible-bootstrap.log"
- "/var/log/cfn-*.log"
# The following are imports from the environment. These are generally # The following are imports from the environment. These are generally
# set in /etc/atl by the CloudFormation template and sourced before # set in /etc/atl by the CloudFormation template and sourced before

View File

@@ -10,5 +10,8 @@ atl_aws_enable_cloudwatch_logs: false
# Mostly for molecule testing, as skip-tags doesn't work with handlers. # Mostly for molecule testing, as skip-tags doesn't work with handlers.
atl_aws_agent_restart: true atl_aws_agent_restart: true
atl_aws_log_group: "{{ atl_product_edition }}-{{ atl_aws_stack_name }}" atl_aws_log_group_base: "{{ atl_product_edition }}-{{ atl_aws_stack_name }}"
atl_aws_provisioning_log_group: "{{ atl_aws_log_group }}-provisioning" atl_aws_log_groups:
product: "{{ atl_aws_log_group_base }}"
audit: "{{ atl_aws_log_group_base }}-audit"
provisioning: "{{ atl_aws_log_group_base }}-provisioning"

View File

@@ -11,19 +11,11 @@
"collect_list": [ "collect_list": [
{% set comma = joiner(',') %} {% set comma = joiner(',') %}
{% for path in atl_product_log_locations[atl_product_family] %} {% for logspec in atl_product_logs[atl_product_family] %}
{{ comma() }} {{ comma() }}
{ {
"file_path": "{{ path }}/*", "file_path": "{{ logspec.path }}",
"log_group_name": "{{ atl_aws_log_group }}", "log_group_name": "{{ atl_aws_log_groups[logspec.type] }}",
"log_stream_name": "{instance_id}"
}
{% endfor %}
{% for path in atl_provisioner_log_locations %}
{{ comma() }}
{
"file_path": "{{ path }}",
"log_group_name": "{{ atl_aws_provisioning_log_group }}",
"log_stream_name": "{instance_id}" "log_stream_name": "{instance_id}"
} }
{% endfor %} {% endfor %}