Skip to content

Structlog

Logfire processor for structlog.

RESERVED_ATTRS module-attribute

RESERVED_ATTRS = RESERVED_ATTRS | {
    "level",
    "event",
    "timestamp",
}

Attributes to strip from the event before sending to Logfire.

LogfireProcessor

LogfireProcessor(
    *,
    console_log: bool = False,
    logfire_instance: Logfire | None = None
)

Logfire processor for structlog.

Source code in logfire/integrations/structlog.py
26
27
28
29
30
31
32
33
34
35
def __init__(
    self,
    *,
    console_log: bool = False,
    logfire_instance: Logfire | None = None,
) -> None:
    self.console_log = console_log
    self.logfire_instance = (logfire_instance or logfire.DEFAULT_LOGFIRE_INSTANCE).with_settings(
        custom_scope_suffix='structlog'
    )