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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 698af11a3e3aec96dbaed7ffb3a1f40b24c12aff6101a9f95d8802770461993d |
|
MD5 | c2291886299ed2d17c70900b1359ff98 |
|
BLAKE2b-256 | 9a67175805d1a50163277f0ebff16d67445aa3fca43e3d2f7a7c8b6c3319cd4e |
Close
Hashes for python_cloud_logger-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00b7a9210f46e0514707cfc4cdc81cdb7cc33ed2e7f49bcb4de20742ad6b0b2e |
|
MD5 | 27c5423a19c8ac72a742df863b6ba6e7 |
|
BLAKE2b-256 | c1f0920c8cb9e2c0780d41f6e04021a9e656f7e8c5d78477afd28151761f612c |