Skip to main content

Aidbox $loggy python logging

Project description

build status codecov pypi Checked with mypy Supported Python version

aidbox-logging-py

Aidbox $loggy python logging handler with queue

Installation

Install from pypi as aidbox-logging

Usage

from aidbox_logging import init_queued_aidbox_loggy_handler, enable_excepthook_logging


logging.basicConfig(
    format="[%(asctime)s] [%(process)d] [%(levelname)s] %(name)s %(message)s",
    datefmt="%Y-%m-%d %H:%M:%S %z",
)
root_logger = logging.getLogger()
root_logger.setLevel(logging.DEBUG)
if env_config.loggy_url:
    loggy_handler = init_queued_aidbox_loggy_handler(
        env_config.loggy_url,
        app="lab-backend",
        version=f"{version.__version__}-{version.__build_commit_hash__}",
        meta={
            "env": env_config.lab_room_id,
        },
    )

    # By default all log messages will be handled by loggy
    root_logger.addHandler(loggy_handler)

    # By default gunicorn errors are not propagated, so we handle it explicitly
    logging.getLogger("gunicorn.error").addHandler(loggy_handler)

    # Optional: enable excepthook logging that intercepts all exceptions inside threads
    enable_excepthook_logging()

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

aidbox_logging-0.1.0b1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

aidbox_logging-0.1.0b1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file aidbox_logging-0.1.0b1.tar.gz.

File metadata

  • Download URL: aidbox_logging-0.1.0b1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for aidbox_logging-0.1.0b1.tar.gz
Algorithm Hash digest
SHA256 90a4d131f05301bf51aac764c3329cda314913cfb11c26d7db786f6dab9a2c8b
MD5 7553dc08ce80e44ceaa443d620ffd150
BLAKE2b-256 5fb74b0d9c91988cebeae7f0784593d768b5911d8cdd3a41d053b32983e62263

See more details on using hashes here.

Provenance

The following attestation bundles were made for aidbox_logging-0.1.0b1.tar.gz:

Publisher: publish.yml on beda-software/aidbox-logging-py

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

File details

Details for the file aidbox_logging-0.1.0b1-py3-none-any.whl.

File metadata

File hashes

Hashes for aidbox_logging-0.1.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 332c7752f9e40cac2449e8b06faae1e28cbc4f11173a9f0f7e1ba846ca5689b8
MD5 74eda43427dd0d5444c307966ab278ac
BLAKE2b-256 4112814d93576463a9f84694b2e006bcce8cac1bf04086db1627a83ef59e9ba0

See more details on using hashes here.

Provenance

The following attestation bundles were made for aidbox_logging-0.1.0b1-py3-none-any.whl:

Publisher: publish.yml on beda-software/aidbox-logging-py

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