structlog: Structured Logging for Python
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.
If you need any help, visit us on #structlog on Freenode!
Release Information
16.0.0 (2016-01-28)
Changes:
structlog.processors.ExceptionPrettyPrinter and structlog.processors.format_exc_info now support passing of Exceptions on Python 3.
Clean up the context when exiting structlog.threadlocal.tmp_bind in case of exceptions. [64]
Be more more lenient about missing __name__s. [62]
Add structlog.dev.ConsoleRenderer that renders the event dictionary aligned and with colors.
Use six for compatibility.
Add structlog.processors.UnicodeDecoder that will decode all byte string values in an event dictionary to Unicode.
Add serializer parameter to structlog.processors.JSONRenderer which allows for using different (possibly faster) JSON encoders than the standard library.
Metadata
Release files for structlog 16.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| structlog-16.0.0.tar.gz | 154.0 kB | Without provenance | Details for structlog-16.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| structlog-16.0.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for structlog-16.0.0-py2.py3-none-any.whl |
Total release size: 183.8 kB
Release files / structlog-16.0.0.tar.gz
| Download URL | structlog-16.0.0.tar.gz |
|---|---|
| Size | 154.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba305858ee5dcd4518d79ee99907565bcd2ccd3f1cfba9679105078d13e566d0
|
|
BLAKE2b-256 checksum How to use checksums |
6e8e7be23d5ef287113264b93676ab67f895f28b5f795d91a9a45ba3f4daeeab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / structlog-16.0.0-py2.py3-none-any.whl
| Download URL | structlog-16.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 29.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
bed91b277972d3cf9090403e0cb3c84f2a38ae890357165892d60e1b0240be84
|
|
BLAKE2b-256 checksum How to use checksums |
353c258e5d3fda2605feae1f384970b20fd3d94d9dd2df216791623438716168
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for structlog 16.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.