Authored by root

支持同步media containers的日志

... ... @@ -6,3 +6,10 @@
[nameserver-master]
10.66.251.10
[media-continers]
10.66.251.13
10.66.251.18
10.66.251.21
10.66.251.24
10.66.251.42
... ...
- hosts: yoho-media
vars:
rsyslog_module: yohomars-platform
rsyslog_files:
- warn-log
- request-timeout
- request-stat
- database-timeout
- database-stat
remote_user: root
roles:
- java-rsyslog
- hosts: yoho-media
vars:
rsyslog_module: yohonow-platform
rsyslog_files:
- warn-log
- request-timeout
- request-stat
- database-timeout
- database-stat
remote_user: root
roles:
- java-rsyslog
- hosts: yoho-media
vars:
rsyslog_module: yohomars-search
rsyslog_files:
- database-timeout
- index-rebuild
- request-timeout
- request-stat
- slow-sql
- warn-log
remote_user: root
roles:
- java-rsyslog
- hosts: yoho-media
vars:
rsyslog_module: yohonow
rsyslog_files:
- request-timeout
- request-stat
- database-timeout
- database-stat
- mq-producer
- mq-consumer
remote_user: root
roles:
- java-rsyslog
- hosts: yoho-media
vars:
rsyslog_module: yohomars
rsyslog_files:
- debug-log
- warn-log
- request-timeout
- request-stat
- database-timeout
- database-stat
- mq-producer
- mq-consumer
- points-raffle-msg
remote_user: root
roles:
- java-rsyslog
... ...
... ... @@ -14,6 +14,14 @@
notify:
- reload rsyslog
- name: define docker modules
set_fact:
docker_modules:
- yohonow-platform
- yohomars-platform
- yohomars-search
- yohonow
- yohomars
- name: sync module rsyslog config files
template:
... ...
{% for rsyslog_file in rsyslog_files %}
{% if rsyslog_module in docker_modules %}
$InputFileName /var/lib/docker/applog/{{rsyslog_module}}/{{ rsyslog_file }}.log
{% else %}
$InputFileName /Data/logs/{{rsyslog_module}}/{{ rsyslog_file }}.log
{% endif %}
$InputFileTag {{ rsyslog_module }},{{ rsyslog_file }}
$InputFileSeverity info
$InputFileStateFile state_{{ rsyslog_module }}_{{ rsyslog_file }}
... ...