A logger with thread local storage for logging context in all logs without repeating the code
Project description
python-cloud-logger
A logger with thread local storage for logging context in all logs without repeating the code. This is a json logger where some contextual fields need to be included in every log per request/thread in a safe and efficient way.
Note that, all the loggers retrieved on that particular thread ( by using logging.getLogger ) will inherit the context.
Usage
from pythoncloudlogger import *
logger=logging.getLogger("myapp-logger")
logger.updateContext({
"requestId" : "1245"
})
logger.info("Request successfully processed")
logger.clearContext()
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
Close
Hashes for python-cloud-logger-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c72024f9a54b101564e7e3ac2c5dcec4a493b0bb6a30121bcadbee8090f7d47 |
|
MD5 | 70ba26738fb31b7bc874a02795c41d97 |
|
BLAKE2b-256 | 578fec7c1227aafff20642c74bab9082e8f2528cbd42b40b9999d15f1615f403 |
Close
Hashes for python_cloud_logger-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c5631a39bc2f08fd8a3b376b5bcf1470dfbb75ccddbd46abf61afa5cfeba1dc |
|
MD5 | 1912cfd76fb70137848c4f24b9e0ed29 |
|
BLAKE2b-256 | 491dbc24271094beb6d1339785bc8e191bf87310c35ad34a3dbd852aa67012c7 |