From 276834296235d6af22824b52b3f1ebe713a6698c Mon Sep 17 00:00:00 2001 From: Anon Ray Date: Fri, 6 Sep 2013 23:14:13 +0530 Subject: [PATCH] Add basic loggin in server --- mouchak/server.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mouchak/server.py b/mouchak/server.py index 7d4a576..4846c5a 100644 --- a/mouchak/server.py +++ b/mouchak/server.py @@ -153,6 +153,15 @@ def static_from_root(): app.config.from_object(conf) +import logging,os +from logging import FileHandler + +fil = FileHandler(os.path.join(os.path.dirname(__file__),'logme'),mode='a') +fil.setLevel(logging.ERROR) +app.logger.addHandler(fil) + + + if __name__ == "__main__": app.run(debug=True, host=conf.HOST, port=conf.PORT) -- 1.7.10.4