pythonjsonlogger.orjson
🔗
JSON Formatter using orjson
OrjsonFormatter
🔗
OrjsonFormatter(
*args,
json_default: OptionalCallableOrStr = orjson_default,
json_indent: bool = False,
**kwargs
)
Bases: BaseJsonFormatter
JSON formatter using orjson for encoding.
PARAMETER | DESCRIPTION |
---|---|
args |
DEFAULT:
|
json_default |
a function for encoding non-standard objects
TYPE:
|
json_indent |
indent output with 2 spaces.
TYPE:
|
kwargs |
DEFAULT:
|
add_fields
🔗
Extract fields from a LogRecord for logging
This method can be overridden to implement custom logic for adding fields.
PARAMETER | DESCRIPTION |
---|---|
log_record |
data that will be logged |
record |
the record to extract data from
TYPE:
|
message_dict |
dictionary that was logged instead of a message. e.g
|
format
🔗
Formats a log record and serializes to json
PARAMETER | DESCRIPTION |
---|---|
record |
the record to format
TYPE:
|
jsonify_log_record
🔗
Returns a json string of the log record.