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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8fa84b09669a5cd999dd5e3f461c4e530ba4d1db724076cc0b6e2eef5cb06b6 |
|
MD5 | d4051e772f70a65121491fb6cab04ff9 |
|
BLAKE2b-256 | 6cac465549559ab75a6d5b39471d66bf3956c2a8ee06e91552d8c76ba415ca8b |
Close
Hashes for python_cloud_logger-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9519376c84e3d62455eb76bc4200efd257fa3df7cb468dec74c27925b4c4bcd7 |
|
MD5 | ddabb5f7740e86471499530771dad0ee |
|
BLAKE2b-256 | c28144b0700afab18fc3cb879319fe9f5f4ef96f0d8266c714886f32ea3eb3f0 |