# Possible for ansible.log to have a DATE or TIMESTAMP in the name of the log?

**URL:** <https://forum.ansible.com/t/possible-for-ansible-log-to-have-a-date-or-timestamp-in-the-name-of-the-log/22501>\
**Category:** Ansible Project\
**Created:** [September 6, 2016, 8:52pm UTC](https://forum.ansible.com/t/possible-for-ansible-log-to-have-a-date-or-timestamp-in-the-name-of-the-log/22501 "2016-09-06T20:52:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Leo\_Huetter](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@John\_Leo\_Huetter](https://forum.ansible.com/u/John_Leo_Huetter)\
**Post date:** [September 6, 2016, 8:52pm UTC](https://forum.ansible.com/t/possible-for-ansible-log-to-have-a-date-or-timestamp-in-the-name-of-the-log/22501/1 "2016-09-06T20:52:29Z")

</div>

Hello, is it possible to add a date or date/time extension to ansible.log files created?

In ansible.cfg, I would like the log files to be created as ansible.log.20160906

I would think based on the other config options I see in ansible.cfg I could make use of the date/time variables, specify the file like so:

log\_path=/app/ansible/logs/ansible.log-%Y%m%d

However, the log gets created as ansible.log-%Y%m%d

Is there a way to do this?

Thanks,  
John

---

<div class="post-metadata">

**Author:** ![Josh\_Smift1](https://avatars.discourse-cdn.com/v4/letter/j/bcef8e/32.png) [@Josh\_Smift1](https://forum.ansible.com/u/Josh_Smift1)\
**Post date:** [September 7, 2016, 1:22pm UTC](https://forum.ansible.com/t/possible-for-ansible-log-to-have-a-date-or-timestamp-in-the-name-of-the-log/22501/2 "2016-09-07T13:22:01Z")

</div>

You could write a wrapper script that sets $ANSIBLE\_LOG\_PATH, and then  
runs Ansible.

(I agree that this seems like a nice feature to have in general though.)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-Josh (jbs@care.com)

(apologies for the automatic corporate disclaimer that follows)

This email is intended for the person(s) to whom it is addressed and may contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, distribution, copying, or disclosure by any person other than the addressee(s) is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email and delete the message and any attachments from your system.
