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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bunnylogs-0.1.1.tar.gz.
File metadata
- Download URL: bunnylogs-0.1.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23fb11c9a119fd64f890498647f0039df3a645224d4e7319c9a21231573a95c7
|
|
| MD5 |
b964ba98e86b7330dcde8d197d115d49
|
|
| BLAKE2b-256 |
4c22d9409b89e5f31dcefc1e7c0879b770ae319a54c56bb2aca173b39e925e00
|
Provenance
The following attestation bundles were made for bunnylogs-0.1.1.tar.gz:
Publisher:
publish.yml on RubenNorgaard/bunnylogs-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bunnylogs-0.1.1.tar.gz -
Subject digest:
23fb11c9a119fd64f890498647f0039df3a645224d4e7319c9a21231573a95c7 - Sigstore transparency entry: 1311887702
- Sigstore integration time:
-
Permalink:
RubenNorgaard/bunnylogs-python@b656308feeed11c85a37b8363f717ee4e9555bf2 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/RubenNorgaard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b656308feeed11c85a37b8363f717ee4e9555bf2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bunnylogs-0.1.1-py3-none-any.whl.
File metadata
- Download URL: bunnylogs-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10aa532c44178197cde1400edaaba979ccd36c085b912917a8cd61f38b004677
|
|
| MD5 |
404f2acdb7880e188c541d304482cf64
|
|
| BLAKE2b-256 |
38141ce8ee4748d7a4a0bc18ce5fe219eb2d609778e016cfae7547225f3edad2
|
Provenance
The following attestation bundles were made for bunnylogs-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on RubenNorgaard/bunnylogs-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bunnylogs-0.1.1-py3-none-any.whl -
Subject digest:
10aa532c44178197cde1400edaaba979ccd36c085b912917a8cd61f38b004677 - Sigstore transparency entry: 1311887767
- Sigstore integration time:
-
Permalink:
RubenNorgaard/bunnylogs-python@b656308feeed11c85a37b8363f717ee4e9555bf2 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/RubenNorgaard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b656308feeed11c85a37b8363f717ee4e9555bf2 -
Trigger Event:
push
-
Statement type: