Easily bind new fields into your logger instances.
# Original logger logger = logging.getLogger('a') logger.info('Hello') logger = logbind.bind(logger, id=12345) logger.info('Hello') # <- This logrecord has an extra field "id" logger = logbind.bind(logger, abc=67890) logger.info('Hello') # <- logrecord has two extra fields: "id" and "abc"
This feature will be most useful with a structured logging formatter, such as JSON. You could try logjson for example.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for logbind-2017.11.7-py2.py3-none-any.whl