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:
|
formatException
๐
Format and return the specified exception information.
If exc_info_as_array is set to True, This method returns an array of strings.
formatStack
๐
Format and return the specified stack information.
If stack_info_as_array is set to True, This method returns an array of strings.
jsonify_log_record
๐
Returns a json string of the log record.