forked from CGM_Public/pretix_original
Log RequestId in Celery tasks
This commit is contained in:
committed by
Raphael Michel
parent
62f2ed55b2
commit
cd63399d51
@@ -28,6 +28,10 @@ from django.dispatch import receiver
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pretix.settings")
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
from pretix.settings import LOGGING
|
||||
|
||||
LOGGING['formatters']['default']['format'] = '[%(asctime)s: %(levelname)s/%(processName)s] RequestId=%(request_id)s %(name)s %(module)s %(message)s'
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
app = Celery('pretix')
|
||||
|
||||
@@ -619,8 +619,6 @@ LOGGING = {
|
||||
'default': {
|
||||
'format': (
|
||||
'%(levelname)s %(asctime)s RequestId=%(request_id)s %(name)s %(module)s %(message)s'
|
||||
if REQUEST_ID_HEADER
|
||||
else '%(levelname)s %(asctime)s %(name)s %(module)s %(message)s'
|
||||
)
|
||||
},
|
||||
},
|
||||
@@ -707,6 +705,7 @@ LOGGING = {
|
||||
},
|
||||
},
|
||||
}
|
||||
CELERY_WORKER_HIJACK_ROOT_LOGGER = False
|
||||
|
||||
SENTRY_ENABLED = False
|
||||
if config.has_option('sentry', 'dsn') and not any(c in sys.argv for c in ('shell', 'shell_scoped', 'shell_plus')):
|
||||
|
||||
Reference in New Issue
Block a user