Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nginx logging #120

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
when: keep_only_specified
- include: remove-unwanted.yml
- include: configuration.yml
- include: monitoring.yml

- name: Start the nginx service
service: name={{ nginx_service_name }} state=started enabled=yes
Expand Down
15 changes: 15 additions & 0 deletions tasks/monitoring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---

- name: Ship nginx access logs to centralized logging infrastructure
watch_logs:
name: nginx-access
file_paths:
- "{{nginx_log_dir}}/*access.log"
tags: [logging,nginx]

- name: Ship nginx error logs to centralized logging infrastructure
watch_logs:
name: nginx-errors
file_paths:
- "{{nginx_log_dir}}/*error.log"
tags: [logging,nginx]