I have a task logging to user.notice, and I can’t change it.
Ansible also logs to user.notice, and I’m wondering if I can change where it does that on a global basis. One of the locals would be nice.
Any way to do this?
Ed Greenberg
I have a task logging to user.notice, and I can’t change it.
Ansible also logs to user.notice, and I’m wondering if I can change where it does that on a global basis. One of the locals would be nice.
Any way to do this?
Ed Greenberg
You can turn it off with no_target_syslog config entry, but there is
no current way of changing the logging target.
This is how I solved the problem in rsyslog.conf:
`
if $pri-text == ‘user.notice’ and $msg contains ‘ansible’ then {
/var/log/ansible.log
stop
}
`
I put this pretty close to the top of the rsyslog.conf, above GLOBAL DIRECTIVES.