Configured logging module.

It's currently configured very simply, to log to stderr and at DEBUG level
when the app is in debug mode, and INFO otherwise.
This commit is contained in:
2016-03-08 09:24:57 +01:00
parent 65f8bdc6c0
commit bf614e0d54

View File

@@ -1,3 +1,4 @@
import logging
import os import os
import json import json
from bson import ObjectId from bson import ObjectId
@@ -91,6 +92,14 @@ app = Eve(settings=settings_path, validator=ValidateCustomFields, auth=NewAuth)
import config import config
app.config.from_object(config.Deployment) app.config.from_object(config.Deployment)
# Configure logging
logging.basicConfig(
level=logging.DEBUG if app.config['DEBUG'] else logging.INFO,
)
log = logging.getLogger(__name__)
log.info('Pillar starting')
bugsnag.configure( bugsnag.configure(
api_key = app.config['BUGSNAG_API_KEY'], api_key = app.config['BUGSNAG_API_KEY'],
project_root = "/data/git/pillar/pillar", project_root = "/data/git/pillar/pillar",