# Generating the custom log file in ansible

**URL:** <https://forum.ansible.com/t/generating-the-custom-log-file-in-ansible/34893>\
**Category:** Ansible Developer\
**Created:** [March 31, 2021, 6:23am UTC](https://forum.ansible.com/t/generating-the-custom-log-file-in-ansible/34893 "2021-03-31T06:23:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Syed\_Kasim](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Syed\_Kasim](https://forum.ansible.com/u/Syed_Kasim)\
**Post date:** [March 31, 2021, 6:23am UTC](https://forum.ansible.com/t/generating-the-custom-log-file-in-ansible/34893/1 "2021-03-31T06:23:07Z")

</div>

I am new to Ansible and Python. We have the following requirements.

Writing logs given in the playbook. Like

tasks:- name: Copying the files  
copy:  
src: some path  
dest: some path  
write\_log: msg: “Copied the files”

The ‘write\_log’ should have the following:

1. Custom message given in the playbook.
2. Output of builtin ‘copy’ module.

We have tried custom callback plugin and achieved the second requirement to get the output of the ‘copy’ module, but unable to get custom message given in the playbook.

Kindly suggest how can we combine both.

Thanks in advance
