Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
log, not mail (bug #656341)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy McKay authored and clouserw committed May 12, 2011
1 parent 61b1b67 commit dfa519e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion services/update.py
Expand Up @@ -73,6 +73,7 @@


timing_log = commonware.log.getLogger('z.timer')
error_log = commonware.log.getLogger('z.services')


def getconn():
Expand Down Expand Up @@ -295,6 +296,11 @@ def mail_exception(data):
conn.close()


def log_exception(data):
(typ, value, traceback) = sys.exc_info()
error_log.error(u'Type: %s, %s. Query: %s' % (typ, value, data))


def application(environ, start_response):
start = time()
status = '200 OK'
Expand All @@ -308,7 +314,8 @@ def application(environ, start_response):
except:
timing_log.info('%s "%s" (500) %.2f [ANON]' %
(timing[0], timing[1], time() - start))
mail_exception(data)
#mail_exception(data)
log_exception(data)
raise
timing_log.info('%s "%s" (200) %.2f [ANON]' %
(timing[0], timing[1], time() - start))
Expand Down

0 comments on commit dfa519e

Please sign in to comment.