Structured Logging for Python
Project description
structlog makes structured logging in Python easy by augmenting your existing logger. It allows you to split your log entries up into key/value pairs and build them incrementally without annoying boilerplate code.
>>> from structlog import get_logger
>>> log = get_logger()
>>> log.info("key_value_logging", out_of_the_box=True, effort=0)
out_of_the_box=True effort=0 event='key_value_logging'
>>> log = log.bind(user='anonymous', some_key=23)
>>> log = log.bind(user='hynek', another_key=42)
>>> log.info('user.logged_in', happy=True)
some_key=23 user='hynek' another_key=42 happy=True event='user.logged_in'
It’s dual-licensed under Apache License, version 2 and MIT, available from PyPI, the source code can be found on GitHub, the documentation at http://www.structlog.org/.
structlog targets Python 2.6, 2.7, 3.3 and newer, and PyPy with no additional dependencies for core functionality.
If you need any help, visit us on #structlog on Freenode!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file structlog-15.3.0.tar.gz
.
File metadata
- Download URL: structlog-15.3.0.tar.gz
- Upload date:
- Size: 68.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87276738473ff00014f3f6ce9adf559d142ca4a71567805c46f09ea61df938c1 |
|
MD5 | 373666bf2cfb5677182e382f7f38e6c2 |
|
BLAKE2b-256 | b8abda68533eb01d7e011a69c9fa93445c3228d92671743fcb96230a4d3ca44d |
File details
Details for the file structlog-15.3.0-py2.py3-none-any.whl
.
File metadata
- Download URL: structlog-15.3.0-py2.py3-none-any.whl
- Upload date:
- Size: 26.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3291786cfd3dfb7067e10886f132dc628f4f6122f5203c1e90911d1bcf24c981 |
|
MD5 | 3e6278652335bb3f141a3e9cdedca116 |
|
BLAKE2b-256 | 7031dc455c8e73dfc3aef454f24c5191116fc38f4f108b2ff9445ca451f4d169 |