# Access the ansible command itself?

**URL:** <https://forum.ansible.com/t/access-the-ansible-command-itself/13143>\
**Category:** Ansible Project\
**Created:** [July 17, 2013, 5:30pm UTC](https://forum.ansible.com/t/access-the-ansible-command-itself/13143 "2013-07-17T17:30:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pierre\_Thibault](https://avatars.discourse-cdn.com/v4/letter/p/bc79bd/32.png) [@Pierre\_Thibault](https://forum.ansible.com/u/Pierre_Thibault)\
**Post date:** [July 17, 2013, 5:30pm UTC](https://forum.ansible.com/t/access-the-ansible-command-itself/13143/1 "2013-07-17T17:30:40Z")

</div>

Hello,

Is it possible to access the Ansible command typed on the command line from Ansible itself? It would like to log the Ansible command when a playbook is run.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [July 17, 2013, 5:39pm UTC](https://forum.ansible.com/t/access-the-ansible-command-itself/13143/2 "2013-07-17T17:39:37Z")

</div>

You’re talking about logging the Ansible command line?

Not in stock ansible, but you could write a modified version of the logging callback that logs sys.argv also when it starts a playbook.

[https://github.com/ansible/ansible/blob/devel/plugins/callbacks/log\_plays.py](https://github.com/ansible/ansible/blob/devel/plugins/callbacks/log_plays.py)
