# How the get the output of module.log calls in a custom module?

**URL:** <https://forum.ansible.com/t/how-the-get-the-output-of-module-log-calls-in-a-custom-module/22234>\
**Category:** Ansible Project\
**Created:** [August 8, 2016, 12:50pm UTC](https://forum.ansible.com/t/how-the-get-the-output-of-module-log-calls-in-a-custom-module/22234 "2016-08-08T12:50:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jakub\_Holy1](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Jakub\_Holy1](https://forum.ansible.com/u/Jakub_Holy1)\
**Post date:** [August 8, 2016, 12:50pm UTC](https://forum.ansible.com/t/how-the-get-the-output-of-module-log-calls-in-a-custom-module/22234/1 "2016-08-08T12:50:27Z")

</div>

Hello!

I am trying to write an Ansible (2.1.x) module. In the module, I make calls to module.log(“some message”) (where module is an instance of ansible.module\_utils.basic.AnsibleModule).

I am not able to find any way to get the logs.

F.ex. at the very beginning of my main, just after instantiating AnsibleModule, I have module.log(“I am here!”). I expected that by creating an ansible.cfg with

[defaults]  
log\_path=ansible.log

I will get this message in the log file - but I do not (though it has task name and output logs). Perhaps that is because the module runs on another machine?

What can I do to get logs from the module, so that I can find out what is it having troubles with?

Thanks a lot!

Cheers, Jakub Holy
