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.3.tar.gz
.
File metadata
- Download URL: structlogger-0.1.3.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.11.4 CPython/3.6.6 Linux/4.17.11-200.fc28.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c96d6384b22828e00b452dc2ff7c363f53408739658699ca57d8a43843da92d |
|
MD5 | 1425d3af68d8f63668e2200f1f0472ed |
|
BLAKE2b-256 | 570184cfc566837b2ee4f171083bb6b5b7df52b776c6e272ee1abce0a090b464 |
File details
Details for the file structlogger-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: structlogger-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.11.4 CPython/3.6.6 Linux/4.17.11-200.fc28.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ea62dfa06566fd96c248b2bc2d4ce9b9dc384b7624c2c22ef6ac4da8d0f6693 |
|
MD5 | b2ba6ed82e8b0abcf7ad448cc26ebb79 |
|
BLAKE2b-256 | 5f1f53c71b8763147152d56adaf77b441d410c5399eac685b7cb632325510a12 |