Sentry
Setting |
|
SDK |
|
Code |
|
Outside ENV_NAME dev, local and test, setup_sentry() initialises the SDK with
environment=ENV_NAME (production, staging). Log records at WARNING and above become Sentry
events — provided they pass the root level LOG_LEVEL, which is ERROR in production. Every
logger.error / logger.exception in a view or task is therefore reported; warnings only on stage.
Async tasks and the stream handler are wrapped in with_error_handler, which logs the
exception with context and re-raises, so the Worker invocation is also marked as failed in
CloudWatch.