title: Python script ran from Bash Script not logging
body: <p>I have a bash script that runs among other things a python script every time the system is booted. </p>
  
  <p>Part of that python script is supposed to be logging to a log file (mostly used for debug purposes).  The script runs fine whether I run it manually or through the bash script.  </p>
  
  <p>The issue is that when I run it through the bash script the Python script does not create the log file nor log any of the debugging LOGGING commands I have in the script. </p>
  
  <p>I am assuming this is a permission issue within the directory. </p>
  
  <p>I'm calling my script from  /etc/rc.local</p>
  
  <pre><code>sudo /home/user/python_scripts/go.sh &amp;
  </code></pre>
  
  <p>Here is the python line in my bash script (go.sh)..</p>
  
  <pre><code>#!/bin/sh
  python /home/user/python_scripts/go.py
  </code></pre>
  
  <p>Inside of my python code I am logging using the following (which when I run manually places the log file in the python_scripts directory:</p>
  
  <pre><code>import logging
  
  daily_log = 'log-' + str(time.strftime("%m-%d-%y")) + '.log'
  
  logging.basicConfig(format='%(asctime)s (%(levelname)s) - %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', filename=daily_log,level=logging.DEBUG)
  
  logging.debug(' Debug Message - Error 1241')
  </code></pre>