From b5fde343edc15f32975d2ff03907fc294322ed07 Mon Sep 17 00:00:00 2001 From: Klavs Klavsen Date: Mon, 14 Oct 2013 15:48:31 +0200 Subject: [PATCH] added wsgi file for passenger - with error handling and logging to tmp file - until I figure out how to make it log to apache error log instead --- passenger_wsgi.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 passenger_wsgi.py diff --git a/passenger_wsgi.py b/passenger_wsgi.py new file mode 100644 index 0000000..5e83340 --- /dev/null +++ b/passenger_wsgi.py @@ -0,0 +1,20 @@ +from __future__ import absolute_import + +import os +import sys +import logging + +me = os.path.dirname(os.path.abspath(__file__)) +# Add us to the PYTHONPATH/sys.path if we're not on it +if not me in sys.path: + sys.path.insert(0, me) + +logfilename = os.path.join('/tmp/', 'puppetboard_passenger_wsgi.log') +# configure the logging +logging.basicConfig(filename=logfilename, level=logging.DEBUG) + +try: + from puppetboard.app import app as application +except Exception, inst: + logging.exception("Error: %s", str(type(inst))) +