Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-cloud-logger-0.0.4.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

python_cloud_logger-0.0.4-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file python-cloud-logger-0.0.4.tar.gz.

File metadata

  • Download URL: python-cloud-logger-0.0.4.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.4

File hashes

Hashes for python-cloud-logger-0.0.4.tar.gz
Algorithm Hash digest
SHA256 b8fd1e173807e26fda1fcf4e73254dc5492ffe7ae467cb47197a6ad76ba80000
MD5 d995efabd3515afd3b3e3edb4562406a
BLAKE2b-256 0efcecce66580af8f4d61e3b070e5371feee7bd6b526e40dacf5f5916431b641

See more details on using hashes here.

File details

Details for the file python_cloud_logger-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: python_cloud_logger-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.4

File hashes

Hashes for python_cloud_logger-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 08d576e388f6ebc2eb85d0d313c186925e9af35cf98e3e09968aebc098625f37
MD5 efe869312214b0641f88a3a970615e78
BLAKE2b-256 3d03afe763f1437b20bb88e839781810c12cab89f11b30c830bb6533e7b2b4a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page