Skip to content

Instantly share code, notes, and snippets.

@amcgregor
Last active March 1, 2017 23:19
logging = {
'version': 1,
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'json',
'level': 'DEBUG' if __debug__ else 'INFO',
'stream': 'ext://sys.stdout',
},
'db': {
'class': 'marrow.mongo.util.logger.MongoHandler',
'uri': DB_URI,
'collection': 'logs',
'level': 'DEBUG' if __debug__ else 'INFO',
}
},
'loggers': {
'illico': {
'level': 'DEBUG' if __debug__ else 'INFO',
'handlers': ['console', 'db'],
'propagate': False,
},
'web': {
'level': 'INFO' if __debug__ else 'WARN',
'handlers': ['console', 'db'],
'propagate': False,
},
},
'root': {
'level': 'DEBUG' if __debug__ else 'WARN',
'handlers': ['console', 'db'],
},
'formatters': {
'json': {'()': 'marrow.mongo.util.logger.JSONFormatter', 'indent': True},
'mongo': {'()': 'marrow.mongo.util.logger.MongoFormatter'},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment