# Logging per playbook file

**URL:** <https://forum.ansible.com/t/logging-per-playbook-file/28986>\
**Category:** Ansible Project\
**Created:** [November 9, 2018, 8:12am UTC](https://forum.ansible.com/t/logging-per-playbook-file/28986 "2018-11-09T08:12:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sorin\_Work](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@Sorin\_Work](https://forum.ansible.com/u/Sorin_Work)\
**Post date:** [November 9, 2018, 8:12am UTC](https://forum.ansible.com/t/logging-per-playbook-file/28986/1 "2018-11-09T08:12:20Z")

</div>

Hi all,

I just recently started using Ansible and really like it!

I’ve enabled the global logging directive in /etc/ansible/ansible.cfg, but I wonder if I can re-point where the log gets saved per playbook?

The setup I have currently is that I have a playbook folder with one playbook per folder, and I’d like that any errors etc get logged to a log-file in that particular folder instead of the global log-file.

Is this possible to achieve?  
Maybe with a directive in each playbook?

Any pointers are appreciated.  
Thanks.

//Sorin

---

<div class="post-metadata">

**Author:** ![Brad2](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Brad2](https://forum.ansible.com/u/Brad2)\
**Post date:** [November 9, 2018, 10:05am UTC](https://forum.ansible.com/t/logging-per-playbook-file/28986/2 "2018-11-09T10:05:45Z")

</div>

I think the only way is to put a different ansible.cfg file in different directories pointing to the different locations. ansible should pick up the ansible.cfg in the current directory if it exists.

---

<div class="post-metadata">

**Author:** ![Thad\_Guidry](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@Thad\_Guidry](https://forum.ansible.com/u/Thad_Guidry)\
**Post date:** [November 9, 2018, 11:00am UTC](https://forum.ansible.com/t/logging-per-playbook-file/28986/3 "2018-11-09T11:00:16Z")

</div>

Ansible only picks up the first ansible.cfg found.

---

<div class="post-metadata">

**Author:** ![Sorin\_Work](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@Sorin\_Work](https://forum.ansible.com/u/Sorin_Work)\
**Post date:** [November 12, 2018, 10:23am UTC](https://forum.ansible.com/t/logging-per-playbook-file/28986/4 "2018-11-12T10:23:26Z")

</div>

Thank you!  
I’l look into that.
