common.runtime.json_logging
config_root_logger
def config_root_logger() -> None
You must call this if you are using root logger. Make all root logger' handlers produce JSON format & remove duplicate handlers for request instrumentation logging. Please made sure that you call this after you called "logging.basicConfig() or logging.getLogger()
init
def init(custom_formatter: Type[logging.Formatter] = None) -> None
This is supposed to be called only one time.
If custom_formatter is passed, it will (in non-web context) use this formatter over the default.
BaseJSONFormatter Objects
class BaseJSONFormatter(logging.Formatter)
Base class for JSON formatters
JSONLogFormatter Objects
class JSONLogFormatter(BaseJSONFormatter)
Formatter for non-web application log
update_formatter_for_loggers
def update_formatter_for_loggers(loggers_iter: List[Logger],
formatter: Type[logging.Formatter]) -> None
Arguments:
formatter
:loggers_iter
: