When I run the app.py use command line
no issue, the log file will be generated and logged.
but when the py file run by apache wsgi
no log comes out
file_log_path = '/var/log/apache2/'
file_log = 'python_app_log.txt'
file_log_full = file_log_path + file_log
logging.basicConfig(filename = file_log_full, level=logging.INFO,
format="%(asctime)s|%(levelname)s|%(funcName)s| %(message)s")
logging.info('Finished init path')
#----- Main-Fucntions ------------------------------------
#-- Set up time ---
logging.info('Main-Fucntions Init...')
tz_utc = tz.tzoffset('UTC Time', 0 * 60)
tz_sql = tz.tzoffset('SQL Server Time', Get_MySQL_TimeZone() * 60)
logging.info(tz_utc)
logging.info('MySQL Server Time zone is ' + tz_sql._name)
#----- Main Process Code must in above--------------------------------------
if __name__ == "__main__":
app.run(host='0.0.0.0')
#app.run(host='0.0.0.0',debug=True)
#app.run(host= '0.0.0.0', port = 30443 ,debug = True)
logging.info('APP RUN Event')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…