Logging
Integration with the standard library logging module.
LogfireLoggingHandler ¶
LogfireLoggingHandler(
level: int | str = NOTSET,
fallback: Handler = StreamHandler(),
)
Bases: Handler
A logging handler that sends logs to Logfire.
Source code in logfire/integrations/logging.py
54 55 56 |
|
emit ¶
Send the log to Logfire.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
LogRecord
|
The log record to send. |
required |
Source code in logfire/integrations/logging.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
fill_attributes ¶
Fill the attributes to send to Logfire.
This method can be overridden to add more attributes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
LogRecord
|
The log record. |
required |
Returns:
Type | Description |
---|---|
dict[str, Any]
|
The attributes for the log record. |
Source code in logfire/integrations/logging.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
本文总阅读量次