# callback plugin log\_plays double output in logs

**URL:** <https://forum.ansible.com/t/callback-plugin-log-plays-double-output-in-logs/26432>\
**Category:** Ansible Project\
**Created:** [January 7, 2018, 4:32am UTC](https://forum.ansible.com/t/callback-plugin-log-plays-double-output-in-logs/26432 "2018-01-07T04:32:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ansiblekrazy](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@ansiblekrazy](https://forum.ansible.com/u/ansiblekrazy)\
**Post date:** [January 7, 2018, 4:32am UTC](https://forum.ansible.com/t/callback-plugin-log-plays-double-output-in-logs/26432/1 "2018-01-07T04:32:49Z")

</div>

Ansible log\_plays plugin is logging double output in logs

```auto
Jan 06 2018 10:20:29 - OK - omitted

  Jan 06 2018 10:20:29 - OK - omitted

  Jan 06 2018 10:20:29 - OK - {"msg": "hello", "changed": false, "_ansible_verbose_always": true, "_ansible_no_log": false}

  Jan 06 2018 10:20:29 - OK - {"msg": "hello", "changed": false, "_ansible_verbose

Playbook I'm running 
 
  - hosts: localhost
    connection: local

    tasks:
      - debug:
          msg: hello

```

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 7, 2018, 8:27am UTC](https://forum.ansible.com/t/callback-plugin-log-plays-double-output-in-logs/26432/2 "2018-01-07T08:27:52Z")

</div>

I can't confirm this behavior with Ansible 2.4.2.0.

---

<div class="post-metadata">

**Author:** ![ansiblekrazy](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@ansiblekrazy](https://forum.ansible.com/u/ansiblekrazy)\
**Post date:** [January 7, 2018, 5:08pm UTC](https://forum.ansible.com/t/callback-plugin-log-plays-double-output-in-logs/26432/3 "2018-01-07T17:08:45Z")

</div>

I’m using ansible verison

ansible --version  
ansible 2.5.0

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

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 7, 2018, 6:10pm UTC](https://forum.ansible.com/t/callback-plugin-log-plays-double-output-in-logs/26432/4 "2018-01-07T18:10:18Z")

</div>

Tried latest, but I don't get double logging

$ ansible --version  
ansible 2.5.0 (devel 2db9878c76) last updated 2018/01/07 18:17:41 (GMT +200)

$ cat /var/log/ansible/hosts/localhost  
Jan 07 2018 19:02:53 - OK - omitted

Jan 07 2018 19:02:53 - OK - {"msg": "hello", "attempts": 1, "changed": false, "\_ansible\_no\_log": false, "\_ansible\_verbose\_always": true}

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [January 8, 2018, 3:17pm UTC](https://forum.ansible.com/t/callback-plugin-log-plays-double-output-in-logs/26432/5 "2018-01-08T15:17:30Z")

</div>

If you copied that callback plugin into your own callback\_plugins directory, it is likely that you are affected by [https://github.com/ansible/ansible/issues/33484](https://github.com/ansible/ansible/issues/33484) which was recently resolved in the devel branch for the 2.5 release.

---

<div class="post-metadata">

**Author:** ![ansiblekrazy](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@ansiblekrazy](https://forum.ansible.com/u/ansiblekrazy)\
**Post date:** [January 9, 2018, 9:00pm UTC](https://forum.ansible.com/t/callback-plugin-log-plays-double-output-in-logs/26432/6 "2018-01-09T21:00:42Z")

</div>

So I defined it under /usr/share/ansible/plugins/callback ansible one. Tested on ansible 2.4.2.0, same result:

Jan 10 2018 02:25:17 - OK - omitted

Jan 10 2018 02:25:17 - OK - omitted

Jan 10 2018 02:25:17 - OK - {“msg”: “hello”, “changed”: false, “\_ansible\_verbose\_always”: true, “\_ansible\_no\_log”: false}

Jan 10 2018 02:25:17 - OK - {“msg”: “hello”, “changed”: false, “\_ansible\_verbose\_always”: true, “\_ansible\_no\_log”: false}

ansible 2.4.2.0

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 12, 2018, 8:57am UTC](https://forum.ansible.com/t/callback-plugin-log-plays-double-output-in-logs/26432/7 "2018-01-12T08:57:17Z")

</div>

What do you mean with defined?

log\_plays is bundled with Ansible 2.4 so you only need to set "stdout\_callback = log\_plays" in ansible.cfg or set the environment variable ANSIBLE\_STDOUT\_CALLBACK=log\_plays

---

<div class="post-metadata">

**Author:** ![ansiblekrazy](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@ansiblekrazy](https://forum.ansible.com/u/ansiblekrazy)\
**Post date:** [January 31, 2018, 7:07am UTC](https://forum.ansible.com/t/callback-plugin-log-plays-double-output-in-logs/26432/8 "2018-01-31T07:07:42Z")

</div>

Is it also work if I use custom ansible.cfg file … how to call callback plugins in custom ansible.cfg
