Uses structlog to create two loggers, a stdout logger with key-value args and optional colour, and a file logger in JSON format with log-rotation.
StructLogger's documentation can be found at https://structlogger.readthedocs.io
StructLogger can be installed from Pypi using pip:
pip install structlogger
StructLogger defines a set of standard parameters that should get you going quickly and easily. Settings are retrofitted to the standard logging module to ensure any of your dependencies will adhere to the same logging format.
import structlog
from structlogger import configure_logger, __version__
configure_logger()
log = structlog.getLogger()
log.info('Welcome to structlogger', version=__version__)