aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bootstrap.py7
-rw-r--r--src/web/lib/crawler.py6
2 files changed, 7 insertions, 6 deletions
diff --git a/src/bootstrap.py b/src/bootstrap.py
index d790ee2f..cd1e71e4 100644
--- a/src/bootstrap.py
+++ b/src/bootstrap.py
@@ -10,12 +10,13 @@ from urllib.parse import urlsplit
def set_logging(log_path, log_level=logging.INFO,
log_format='%(asctime)s %(levelname)s %(message)s'):
- logger = logging.getLogger('jarr')
formater = logging.Formatter(log_format)
handler = logging.FileHandler(log_path)
handler.setFormatter(formater)
- logger.addHandler(handler)
- logger.setLevel(log_level)
+ for logger_name in ('bootstrap', 'web', 'manager', 'runserver'):
+ logger = logging.getLogger(logger_name)
+ logger.addHandler(handler)
+ logger.setLevel(log_level)
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
diff --git a/src/web/lib/crawler.py b/src/web/lib/crawler.py
index 979ccbfc..7343ea4d 100644
--- a/src/web/lib/crawler.py
+++ b/src/web/lib/crawler.py
@@ -155,9 +155,9 @@ class FeedCrawler(AbstractCrawler):
response.raise_for_status()
except Exception as error:
error_count = self.feed['error_count'] + 1
- logger.error('%r %r - an error occured while fetching '
- 'feed; bumping error count to %r', self.feed['id'],
- self.feed['title'], error_count)
+ logger.exception('%r %r - an error occured while fetching '
+ 'feed; bumping error count to %r',
+ self.feed['id'], self.feed['title'], error_count)
future = self.query_pyagg('put', 'feed/%d' % self.feed['id'],
{'error_count': error_count,
'last_error': str(error),
bgstack15