|
|
|
@ -56,7 +56,7 @@ def create_app(config_class=Config):
@@ -56,7 +56,7 @@ def create_app(config_class=Config):
|
|
|
|
|
mail_handler = SMTPHandler( |
|
|
|
|
mailhost=(app.config['MAIL_SERVER'], app.config['MAIL_PORT']), |
|
|
|
|
fromaddr='no-reply@' + app.config['MAIL_SERVER'], |
|
|
|
|
toaddrs=app.config['ADMINS'], subject='Microblog Failure', |
|
|
|
|
toaddrs=app.config['ADMINS'], subject='The-Hunt Failure', |
|
|
|
|
credentials=auth, secure=secure) |
|
|
|
|
mail_handler.setLevel(logging.ERROR) |
|
|
|
|
app.logger.addHandler(mail_handler) |
|
|
|
@ -68,7 +68,7 @@ def create_app(config_class=Config):
@@ -68,7 +68,7 @@ def create_app(config_class=Config):
|
|
|
|
|
else: |
|
|
|
|
if not os.path.exists('logs'): |
|
|
|
|
os.mkdir('logs') |
|
|
|
|
file_handler = RotatingFileHandler('logs/microblog.log', |
|
|
|
|
file_handler = RotatingFileHandler('logs/the-hunt.log', |
|
|
|
|
maxBytes=10240, backupCount=10) |
|
|
|
|
file_handler.setFormatter(logging.Formatter( |
|
|
|
|
'%(asctime)s %(levelname)s: %(message)s ' |
|
|
|
@ -77,7 +77,7 @@ def create_app(config_class=Config):
@@ -77,7 +77,7 @@ def create_app(config_class=Config):
|
|
|
|
|
app.logger.addHandler(file_handler) |
|
|
|
|
|
|
|
|
|
app.logger.setLevel(logging.INFO) |
|
|
|
|
app.logger.info('Microblog startup') |
|
|
|
|
app.logger.info('The-Hunt startup') |
|
|
|
|
|
|
|
|
|
return app |
|
|
|
|
|
|
|
|
|