title: ansible remote script execution's log in local machine
body: <p>I have python script which basically do verification of installed services in remote machine.This script will run in remote machine and I am using ansible to call this script.I having trouble in logging the script in to a file in local machine.    </p>
  
  <p><strong>test.yml (Ansible)</strong></p>
  
  <pre><code>      - name: Verifying route ,run script to analyse temp_route.txt file
          script: /scripts/verify.py {{ prox1 }},{{ ip }} {{ ip }}
          register: output
  </code></pre>
  
  <p><strong>verify.py</strong></p>
  
  <pre><code>#from pprint import pprint
  logging.basicConfig(filename='script/logs/install.log',format='%(asctime)s | %(levelname)s | %(message)s', datefmt='%a %b %d %H:%M:%S %Z %Y', level=logging.INFO)
  
  def func1():
      ----do something
      logging.info('%s %s',key, value)
  </code></pre>
  
  <p>All our script uses this way of logging ....other than this all script run locally.Only this one runs on remote machine.</p>
  
  <p>While running the script i get ansible error path not found.It seems it is searching path in remote machine which is not available     </p>
  
  <p><strong>UPDATED</strong>    </p>
  
  <p>I have machine A where all the script runs and I am launching a vm from that machine and configuring it using ansible. I have log file called install.log.
  All the other script output the log in this file.I want my verify.py which will run on remote should also output log in install.log file</p>
  
  <p>Is this possible to do it through ansible ?</p>