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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e5dd983fc69e533c0bf7f70e310d3f2180be65c05ce60848887f4e2477201e1 |
|
MD5 | fd68fc7a63a1ff8c8576e2b59bae1135 |
|
BLAKE2b-256 | 2e382e51e347b21f50ab0377a8aac9e77c05ab909d6e90a01e60352fad5ca5be |
Close
Hashes for python_cloud_logger-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9c41a12f5352f203212af100c391f6697d61c2b2d1ea40e903d4218da36db50 |
|
MD5 | 3eee8f80c38fd0fbefa5ba486bdb7fe8 |
|
BLAKE2b-256 | 872e2e826d3e2ec1767a6a0fe4f196b1ef6cc018035456d5bbfa6365d7f26566 |