Docs: https://reconplogger.readthedocs.io/ | Source: https://github.com/omni-us/reconplogger/
This repository contains the code of reconplogger, a python package intended to ease the standardization of logging within omni:us. The main design decision of reconplogger is to allow total freedom to reconfigure loggers without hard coding anything.
The package contains essentially the following things:
- A default logging configuration.
- A function for loading logging configuration for regular python code.
- A function for loading logging configuration for flask-based microservices.
- Root logger configuration via
LOGGER_ROOT_HANDLERwith independentLOGGER_ROOT_LEVELcontrol. - Singleton logger setup (
logger_setup); callreset_configsbefore reconfiguring. - Automatic correlation ID management in Flask services via
flask_app_logger_setup. - An inheritable class to add a logger property.
- A context manager to set and get the correlation id.
- Lower level functions for:
- Loading logging configuration from any of: config file, environment variable, or default.
- Replacing the handlers of an existing Logger object.
- Function to add a file handler to a logger.