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.
Project description
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.
Documentation
StructLogger’s documentation can be found at https://structlogger.readthedocs.io
Installing StructLogger
StructLogger can be installed from Pypi using pip:
pip install structlogger
Example
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__)
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 structlogger-0.1.4.tar.gz
.
File metadata
- Download URL: structlogger-0.1.4.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6a46715e27e63a9e63615e3030ddca81363aaf68e718f2910fdd0662395c9dd |
|
MD5 | ff6f14b02254452d2ce0cdccf9913f0b |
|
BLAKE2b-256 | 309899f3748053dcda67875f08a1d070eba93f7948a7ce9962c8dad111f995f0 |
File details
Details for the file structlogger-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: structlogger-0.1.4-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99a3ebfe14e28e6765599a3b50ab809e252551ab9ce2f8b57e77c7d7e5f72af7 |
|
MD5 | 13578029b96853bfd3be2145d6051224 |
|
BLAKE2b-256 | 6ca07ea95c52224b93eeb985c137890f7c176a924c5a871acf48b1112eebf695 |