ansible simplified log with date|host|playbook ?

Hi,

I have been writting some roles and playbooks before getting ansible in production. Now I have the most important stuff working (I hope) and I would like to generate a simple ansible log to keep track of what playbooks I apply to which hosts without deeper details.

I would like to have a log file in the ansible master machine in /var/logs/ansible/hosts/hostname.log with this format:

DATE | HOST | PATH_TO_APPLIED_PLAYBOOK

Ideally I would like that the same log file is copied in the client machines when the playbook is executed.

I think the right approach would be to use a callback like this one https://github.com/ansible/ansible/blob/devel/plugins/callbacks/log_plays.py but that one is giving too much information and I don’t know how to adapt it to print just the information I want.

is there any published callback doing this simplified ansible logging? or can anyone point to the right documentation I should check be able to adapt the log_plays.py callback?

thanks in advance for your help
Pablo.

by default, ansible logs to syslog on the target host machines, you
can also point to a file on the 'master' by setting the log_path = in
ansible.cfg.

you could also use a custom callback module to modify how things get
logged on the master.