Permalink
Browse files

add file logging too

  • Loading branch information...
1 parent effa8c8 commit 4320a60e5898adc3b2d5ad5dc938de840cf79fe3 @jcarbaugh jcarbaugh committed Jun 15, 2010
Showing with 6 additions and 0 deletions.
  1. +6 −0 wsgiapp.py
View
@@ -4,6 +4,7 @@
if not settings.DEBUG:
import logging
+
from logging.handlers import SMTPHandler
mail_handler = SMTPHandler(settings.SMTP_HOST,
'geocron.us@gmail.com',
@@ -12,6 +13,11 @@
(settings.SMTP_USER, settings.SMTP_PASSWORD))
mail_handler.setLevel(logging.ERROR)
application.logger.addHandler(mail_handler)
+
+ from logging.handlers import FileHandler
+ file_handler = FileHandler("/tmp/geocron.log")
+ file_handler.setLevel(logging.WARNING)
+ application.logger.addHandler(file_handler)
applications = {
'/': application,

0 comments on commit 4320a60

Please sign in to comment.