Skip to main content

Management and injection of contextual variables into log messages.

Reason this release was yanked:

invalid version

Project description

CICD

Enabling

The core module provides a logging.Filter subclass designed to inject the current active context into any log messages.

Below is a demo usage on how to enable context injection:

import logging
import logctx

root_logger = logging.getLogger()
console_handler = logging.StreamHandler()

formatter = jsonlogger.JsonFormatter("%(logctx)s")
context_filter = ContextInjectingLoggingFilter(output_field="logctx")

console_handler.setFormatter(formatter)
console_handler.addFilter(context_filter)

root_logger.addHandler(console_handler)
logger.setLevel(logging.DEBUG)

Generators

  • During execution
  • Between yields

Log Arguments

  • Raises during initializtaion
  • Value Error
  • Able to rename args
  • Unable to extract from kwargs
  • Unable to work on generators
  • Unable to work on async functions

update

  • can change root context

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

logctx-0.0.0.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

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

logctx-0.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file logctx-0.0.0.tar.gz.

File metadata

  • Download URL: logctx-0.0.0.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for logctx-0.0.0.tar.gz
Algorithm Hash digest
SHA256 c03178d64dffb8fbebdb3275bca6c53b52b8a736b60e35c8407df8656abb94a8
MD5 a478e4b783e661587dbed2e5089c962b
BLAKE2b-256 a5e972411b7496d4491b31ea19c9b31ec39673baacb04115d3453bb6dc158b31

See more details on using hashes here.

Provenance

The following attestation bundles were made for logctx-0.0.0.tar.gz:

Publisher: release.yml on aschulte201/logctx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file logctx-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: logctx-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for logctx-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49e51e45eefbb224f7a6de7bc8ab0fb1c13ed32c67c53071a3dc7f0a6e2ae617
MD5 c982f953f04792f72334a2abdbfb1527
BLAKE2b-256 bbf2a3520b3a6203ed92fb7b06add0843e12257ab40eacb1a4213ede0dfb55f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for logctx-0.0.0-py3-none-any.whl:

Publisher: release.yml on aschulte201/logctx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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