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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8fd1e173807e26fda1fcf4e73254dc5492ffe7ae467cb47197a6ad76ba80000 |
|
MD5 | d995efabd3515afd3b3e3edb4562406a |
|
BLAKE2b-256 | 0efcecce66580af8f4d61e3b070e5371feee7bd6b526e40dacf5f5916431b641 |
Close
Hashes for python_cloud_logger-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08d576e388f6ebc2eb85d0d313c186925e9af35cf98e3e09968aebc098625f37 |
|
MD5 | efe869312214b0641f88a3a970615e78 |
|
BLAKE2b-256 | 3d03afe763f1437b20bb88e839781810c12cab89f11b30c830bb6533e7b2b4a2 |