Skip to main content

Python logging handler for BunnyLogs

Project description

bunnylogs

Python logging handler for BunnyLogs — ship your logs to a live stream with three lines of code.

Install

pip install bunnylogs

Usage

import logging
from bunnylogs import BunnyLogsHandler

logging.getLogger().addHandler(BunnyLogsHandler("your-uuid-here"))

That's it. Every log record at WARNING and above (or whatever level your root logger is set to) will appear in your BunnyLogs stream in real time.

Capture a specific logger

import logging
from bunnylogs import BunnyLogsHandler

handler = BunnyLogsHandler("your-uuid-here")
handler.setLevel(logging.DEBUG)

logger = logging.getLogger("myapp")
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)

Django — settings.py

LOGGING = {
    "version": 1,
    "handlers": {
        "bunnylogs": {
            "class": "bunnylogs.BunnyLogsHandler",
            "uuid": "your-uuid-here",
        },
    },
    "root": {
        "handlers": ["bunnylogs"],
        "level": "WARNING",
    },
}

Self-hosted deployments

BunnyLogsHandler("your-uuid-here", endpoint="https://your-own-host.com")

How it works

Log records are placed on an in-process queue and flushed by a daemon thread, so emit() is non-blocking (~microseconds on the calling thread). The background thread sends one HTTPS POST per record using only the Python standard library — no external dependencies.

On process exit the daemon thread is killed. Call handler.close() explicitly if you need to guarantee all queued records are flushed before shutdown.

Parameters

Parameter Default Description
uuid Your logspace UUID
level logging.NOTSET Minimum level to forward
endpoint https://bunnylogs.com Base URL (override for self-hosted)
timeout 5 HTTP request timeout in seconds

License

MIT

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

bunnylogs-0.1.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

bunnylogs-0.1.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file bunnylogs-0.1.2.tar.gz.

File metadata

  • Download URL: bunnylogs-0.1.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bunnylogs-0.1.2.tar.gz
Algorithm Hash digest
SHA256 94dc06dff1ed1bb923401262c5956210e81dbc205cd658c1f45daa7941b4916d
MD5 15ac5e2b645e72aeeecea24fcd8f1b49
BLAKE2b-256 3b442234bbcd1ed03db51d87eb29dcb85b7d839df3b51a0a2a73b4c66f5361c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for bunnylogs-0.1.2.tar.gz:

Publisher: publish.yml on RubenNorgaard/bunnylogs-python

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

File details

Details for the file bunnylogs-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: bunnylogs-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bunnylogs-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b65074a097e1e5e23e9786b9adf3a4ff5efea98f57e46990e434cb77aaafcc90
MD5 d301c32e47b965e7af8a9cb663e474bf
BLAKE2b-256 5ceb9008888c13cb1c30fdd29649127aeaec8035e3f9e7638ce69e45eb70afe2

See more details on using hashes here.

Provenance

The following attestation bundles were made for bunnylogs-0.1.2-py3-none-any.whl:

Publisher: publish.yml on RubenNorgaard/bunnylogs-python

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