Skip to main content

ustack-logging

Default logging configuration for uStack style Python applications.

Installation

pip install ustack-logging

Usage

from ustack_logging.logging_configuration import configure_logging


def main():
    configure_logging()

    # Run your application


if __name__ == "__main__":
    main()

Intent

This library is intended to codify the standard way uStudio Python applications log and report errors when running inside Kubernetes. It takes no configuration because its intent is to enforce a configuration.

However, it is built on datadog-logger, which is configurable. If you need a different configuration, it should be trivial to implement it using that library directly.

Configuration

The library configures the following things:

It sets up the logging library to log the time, log level, module name and log message for every message, and it sets the current log level to INFO.

In order to function, it uses a secret named environment-info in the ustudio-system namespace. The secret must contain the keys environment and datadog-api-key, and the pod must contain a label named role.

If any information is missing or any connections fail it logs a warning and does not error.

It configures the datadog-logger library to send ERROR and above log messages to Datadog as events, with the following tag mapping:

  • environment-info.environment -> Datadog tag environment
  • K8s Pod Namespace -> Datadog tag service
  • K8s Pod Label role -> Datadog tag role

Metadata

Release files for ustack-logging 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ustack-logging 1.0.3
File Size Uploaded Provenance Actions
ustack_logging-1.0.3.tar.gz 2.1 kB Without provenance Details for ustack_logging-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ustack-logging 1.0.3
File Interpreter ABI Platform Actions
ustack_logging-1.0.3-py3-none-any.whl Python 3 none any Details for ustack_logging-1.0.3-py3-none-any.whl

Total release size: 4.9 kB

Release files / ustack_logging-1.0.3.tar.gz

Download URL ustack_logging-1.0.3.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
223ae9c46aa5779ccb4d1d83dd52f1c5d034881a913d12885076b9f0dbe10a2f
BLAKE2b-256 checksum
How to use checksums
4df8eef3dde29cfe91843666f6bee258305c77feca283574eea0e5edcceb7f0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.15.1 Linux/7.0.0-1014-aws

Release files / ustack_logging-1.0.3-py3-none-any.whl

Download URL ustack_logging-1.0.3-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61d319b3f6866548fbe52f155fb563288dbbe1dc44ce4ade5e8f5331c64dd183
BLAKE2b-256 checksum
How to use checksums
3583779186d51585e690cf35131bd2909ff8ee3da06c50802e6a9b9d86239cfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.15.1 Linux/7.0.0-1014-aws

Security for ustack-logging 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page