Merge pull request #573 from coreos-inc/buildschmonitor
Add exception logging to the build manager
This commit is contained in:
commit
5505707884
1 changed files with 9 additions and 0 deletions
|
@ -2,6 +2,7 @@ import logging
|
||||||
import os
|
import os
|
||||||
import features
|
import features
|
||||||
import time
|
import time
|
||||||
|
import socket
|
||||||
|
|
||||||
from app import app, userfiles as user_files, build_logs, dockerfile_build_queue
|
from app import app, userfiles as user_files, build_logs, dockerfile_build_queue
|
||||||
|
|
||||||
|
@ -10,6 +11,8 @@ from buildman.manager.ephemeral import EphemeralBuilderManager
|
||||||
from buildman.server import BuilderServer
|
from buildman.server import BuilderServer
|
||||||
|
|
||||||
from trollius import SSLContext
|
from trollius import SSLContext
|
||||||
|
from raven.handlers.logging import SentryHandler
|
||||||
|
from raven.conf import setup_logging
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -77,4 +80,10 @@ if __name__ == '__main__':
|
||||||
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
|
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
|
||||||
logging.getLogger('peewee').setLevel(logging.WARN)
|
logging.getLogger('peewee').setLevel(logging.WARN)
|
||||||
logging.getLogger('boto').setLevel(logging.WARN)
|
logging.getLogger('boto').setLevel(logging.WARN)
|
||||||
|
|
||||||
|
if app.config.get('EXCEPTION_LOG_TYPE', 'FakeSentry') == 'Sentry':
|
||||||
|
buildman_name = '%s:buildman' % socket.gethostname()
|
||||||
|
setup_logging(SentryHandler(app.config.get('SENTRY_DSN', ''), name=buildman_name,
|
||||||
|
level=logging.ERROR))
|
||||||
|
|
||||||
run_build_manager()
|
run_build_manager()
|
||||||
|
|
Reference in a new issue