# Ansible log location in command line?

**URL:** <https://forum.ansible.com/t/ansible-log-location-in-command-line/19223>\
**Category:** Ansible Project\
**Created:** [September 10, 2015, 8:47am UTC](https://forum.ansible.com/t/ansible-log-location-in-command-line/19223 "2015-09-10T08:47:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amir\_Luzon](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@Amir\_Luzon](https://forum.ansible.com/u/Amir_Luzon)\
**Post date:** [September 10, 2015, 8:47am UTC](https://forum.ansible.com/t/ansible-log-location-in-command-line/19223/1 "2015-09-10T08:47:18Z")

</div>

hi there,

is it at all possible to run a playbook and configure in the command like a specific location for the log file for this run?

say i have 4 playbook i want to run. i want to create separation of log files per each playbook. i know i can edit the ansible.cfg file before each run but i would prefer to avoid this.

any thoughts?

---

<div class="post-metadata">

**Author:** ![jean-yves](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jean-yves](https://forum.ansible.com/u/jean-yves)\
**Post date:** [September 10, 2015, 9:15am UTC](https://forum.ansible.com/t/ansible-log-location-in-command-line/19223/2 "2015-09-10T09:15:11Z")

</div>

Hi,

Perhaps, you should try settings this environment variable to a different path when launching your different playbooks :

ANSIBLE\_LOG\_PATH

Regards,

JY

---

<div class="post-metadata">

**Author:** ![Amir\_Luzon](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@Amir\_Luzon](https://forum.ansible.com/u/Amir_Luzon)\
**Post date:** [September 10, 2015, 12:33pm UTC](https://forum.ansible.com/t/ansible-log-location-in-command-line/19223/3 "2015-09-10T12:33:52Z")

</div>

I tried the following:

- [ansible-playbook command] -e “log\_path=./blabla.log” which did not work

- [ansible-playbook command] -e “ANSIBLE\_LOG\_PATH=./blabla.log” which did not work as well

i tried these with a value of “log\_path” in ansible config file and without it and still the same behavior. seems like ansible only takes note of what is configured in ansible.cfg

I would assume that there has to be a way to override this value…

---

<div class="post-metadata">

**Author:** ![jean-yves](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jean-yves](https://forum.ansible.com/u/jean-yves)\
**Post date:** [September 10, 2015, 12:57pm UTC](https://forum.ansible.com/t/ansible-log-location-in-command-line/19223/4 "2015-09-10T12:57:12Z")

</div>

Reread carefully I tell about an environment variable not an ansible variable...

You should do something like :

ANSIBLE\_LOG\_PATH="./blabla.log" ansible-playbook myprefered-playbook.yml

or

export ANSIBLE\_LOG\_PATH="./blabla.log"  
ansible-playbook myprefered-playbook.yml

Regards,
