structlog_sentry_logger.structlog_sentry
Fork of structlog-sentry which adds full type information.
Necessary for proper Mypyc C extension compilation.
Will directly depend on structlog-sentry once associated PR is merged upstream
(see: kiwicom/structlog-sentry#44).
Module Contents
Classes
JSON Processor which logs breadcrumbs to Sentry. |
|
Sentry processor for structlog which uses JSONRenderer. |
|
Sentry processor for structlog. |
- class structlog_sentry_logger.structlog_sentry.SentryBreadcrumbJsonProcessor(breadcrumb_level=logging.INFO, level=logging.WARNING, active=True, as_extra=True, tag_keys=None)
Bases:
SentryJsonProcessor
JSON Processor which logs breadcrumbs to Sentry.
Addresses: SentryJsonProcessor breaks logging breadcrumbs #25 (source).
Initializes a structlog processor to handle Sentry events in JSON logs and include breadcrumbs.
- Parameters:
- active = True
- breadcrumb_level = 20
- level = 30
- tag_keys = None
- static save_breadcrumb(logger, event_dict)
Saves logging breadcrumbs for Sentry events.
- Parameters:
logger (Any)
event_dict (structlog.types.EventDict)
- Return type:
None
- class structlog_sentry_logger.structlog_sentry.SentryJsonProcessor(level=logging.WARNING, active=True, as_extra=True, tag_keys=None)
Bases:
SentryProcessor
Sentry processor for structlog which uses JSONRenderer.
Uses Sentry SDK to capture events in Sentry.
Initializes a structlog processor to handle Sentry events in JSON logs.
- active = True
- level = 30
- tag_keys = None
- class structlog_sentry_logger.structlog_sentry.SentryProcessor(level=logging.WARNING, active=True, as_extra=True, tag_keys=None, ignore_loggers=None)
Sentry processor for structlog.
Uses Sentry SDK to capture events in Sentry.
Initializes a structlog processor to handle Sentry events.
- Parameters:
level (int) – events of this or higher levels will be reported to Sentry.
active (bool) – a flag to make this processor enabled/disabled.
as_extra (bool) – send event_dict as extra info to Sentry.
tag_keys (list[str] | str | None) – a list of keys. If any if these keys appear in event_dict, the key and its corresponding value in event_dict will be used as Sentry event tags. use “__all__” to report all key/value pairs of event as tags.
ignore_loggers (Iterable[str] | None) – a list of logger names to ignore any events from.
- active = True
- level = 30
- tag_keys = None