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.2.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_cloud_logger-0.0.2-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python-cloud-logger-0.0.2.tar.gz
  • Upload date:
  • Size: 1.8 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.2.tar.gz
Algorithm Hash digest
SHA256 1e5dd983fc69e533c0bf7f70e310d3f2180be65c05ce60848887f4e2477201e1
MD5 fd68fc7a63a1ff8c8576e2b59bae1135
BLAKE2b-256 2e382e51e347b21f50ab0377a8aac9e77c05ab909d6e90a01e60352fad5ca5be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_cloud_logger-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f9c41a12f5352f203212af100c391f6697d61c2b2d1ea40e903d4218da36db50
MD5 3eee8f80c38fd0fbefa5ba486bdb7fe8
BLAKE2b-256 872e2e826d3e2ec1767a6a0fe4f196b1ef6cc018035456d5bbfa6365d7f26566

See more details on using hashes here.

Supported by

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