Commit 8181191aeed47706543d65a4c5903aadc3799255

  • avatar
  • arvind
  • Fri Feb 08 11:28:37 IST 2013
Adding feature
			 - Flask app will log the errors on to a log file now.  Don't have to depend on apache to do it and spend hours on debugging in production.
fetch.py
(6 / 0)
  
22from flask import request
33from flask import render_template
44from flask import make_response
5from logging import FileHandler
56import json
67import pymongo
78import os
6161 return i.split('/')[-1]
6262 ls = map(sanitize, ls)
6363 return render_template('history.html', ls=ls)
64
65#Log the errors, don't depend on apache to log it for you.
66fil = FileHandler(os.path.join(os.path.dirname(__file__),'logme'),mode='a')
67fil.setLevel(logging.ERROR)
68app.logger.addHandler(fil)
6469
6570
6671if __name__ == "__main__":