# Separate ansible logs for distinct target nodes

**URL:** <https://forum.ansible.com/t/separate-ansible-logs-for-distinct-target-nodes/44406>\
**Category:** Get Help\
**Tags:** rhel9\
**Created:** [September 2, 2025, 6:34pm UTC](https://forum.ansible.com/t/separate-ansible-logs-for-distinct-target-nodes/44406 "2025-09-02T18:34:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtwest](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mtwest/32/9395_2.png) [@mtwest](https://forum.ansible.com/u/mtwest)\
**Post date:** [September 2, 2025, 6:34pm UTC](https://forum.ansible.com/t/separate-ansible-logs-for-distinct-target-nodes/44406/1 "2025-09-02T18:34:54Z")

</div>

```auto
OS_Version: RHEL9.6_Plow
python_version: 3.12.9
ansible-core: 2.18.6

```

It seems that the structure of `ansible.cfg`, particular as it relates to logging has changed markedly in the last few years, and I am trying to an up-to-date understanding of current SOP.

**CONTEXT**  
I maintain many relatively recent ( \< 6 year) bare-metal Dell boxes and would like to keep separate logs for each nodes. We are currently transitioning to using Ansible for our node configuration and away from [Bundle](https://www.eyrie.org/~eagle/notes/bundle.html). This is also a \< 1-FTE allocation, just to put the staffing resources into context, and our primary responsibility is to keep our current ecosystem running smoothly on legacy code while the new Ansible framework is developed.

**QUESTIONS**

- Is it possible have the Ansible log file for each machine be recorded locally on the target host and rather than as part of the LARGE log on the controller?
- If not, is there a way to segment log information for each node into a different file via Ansible configuration itself on the controller?

---

<div class="post-metadata">

**Author:** ![anon81884396](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anon81884396](https://forum.ansible.com/u/anon81884396)\
**Post date:** [September 2, 2025, 7:46pm UTC](https://forum.ansible.com/t/separate-ansible-logs-for-distinct-target-nodes/44406/2 "2025-09-02T19:46:25Z")

</div>

This callback plugin may be what you’re after: [community.general.log\_plays callback – write playbook output to log file — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/collections/community/general/log_plays_callback.html#ansible-collections-community-general-log-plays-callback)

I use AWX but I’ll spare suggesting that since you said you had fewer than 1 FTE resource to dedicate to this. I haven’t used callback plugins myself but as far as I understand, you configure them in your ansible.cfg (more info: [https://docs.ansible.com/ansible/latest/plugins/callback.html](https://docs.ansible.com/ansible/latest/plugins/callback.html))

I have never heard of bundle before your post, and looking at the webpage left me in horror seeing it was written in Perl, and even more horror it was last updated in 2008. Good luck to you, sir.

---

<div class="post-metadata">

**Author:** ![mtwest](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mtwest/32/9395_2.png) [@mtwest](https://forum.ansible.com/u/mtwest)\
**Post date:** [September 3, 2025, 9:46pm UTC](https://forum.ansible.com/t/separate-ansible-logs-for-distinct-target-nodes/44406/3 "2025-09-03T21:46:31Z")

</div>

Within my local `ansible.cfg`, which is derived from the template [generated](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#generating-a-sample-ansible-cfg-file) with `ansible-config`, does have:

```ini
[defaults]
# (path) File to which Ansible will log on the controller.
# When not set the logging is disabled.
;log_path=

# (boolean) Toggle Ansible logging to syslog on the target when it executes tasks. On Windows hosts, this will disable a newer style PowerShell modules from writing to the event log.
;no_target_syslog=False

# (string) Syslog facility to use when Ansible logs to the remote target.
;syslog_facility=LOG_USER

```

So at minimum, I need to specify the `log_path` in order to make logging work regardless of where I want to put the files in the end.

* * *

OK, so [`community.general.log_plays`](https://docs.ansible.com/ansible/latest/collections/community/general/log_plays_callback.html#ansible-collections-community-general-log-plays-callback) directs logging information on a 1-file per host basis to an alternative directory. Do wish the module name was a little less generic. 🤷

```ini
[defaults]
# Activate logging and store a copy of information in /tmp 
log_path=/tmp/ansible_logs

# need log_plays enabled in order to log on a per host basis
callbacks_enabled=community.general.log_plays

[callback_log_plays]
# where to put the per-host log files (shivers at use of "folder" on linux)
log_folder=/var/log/ansible/

```

Have I got this right, @anon81884396?

Also, I appreciate the restraint on not pitching **AWX**. I would love something a bit more robust but only have so much mental bandwidth.

---

<div class="post-metadata">

**Author:** ![mtwest](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mtwest/32/9395_2.png) [@mtwest](https://forum.ansible.com/u/mtwest)\
**Post date:** [September 3, 2025, 9:48pm UTC](https://forum.ansible.com/t/separate-ansible-logs-for-distinct-target-nodes/44406/4 "2025-09-03T21:48:30Z")

</div>

While @anon81884396 has pointed out the _per-host_ log file _on controller_ solution, does anyone know how to do that but put the log file _on the target_ instead?

There are the options

```ini
no_target_syslog = False
syslog_facility = /var/log/ansible/ansible.log

```

but I do not understand `syslog` well enough to understand whether it is working the way I want or expect it to.
