Ship Python logs to Logotto via OTLP
Project description
logotto
Ship Python logs to Logotto with one line.
Install
pip install logotto
Quickstart
The fastest path — set your credentials as environment variables and import logotto.auto. This attaches a handler to Python's root logger so any existing logging calls in your code (and in libraries you use) are automatically captured and forwarded to Logotto. No other changes to your code needed.
export LOGOTTO_API_KEY=your-api-key
export LOGOTTO_APP_NAME=my-app
import logotto.auto
import logging
logging.info("Server started")
logging.error("Something broke")
That's it. All logging calls are automatically captured and shipped.
Explicit setup
If you prefer to initialise in code:
import logotto
import logging
logotto.init(api_key="your-api-key", app_name="my-app")
logging.info("Server started")
logging.warning("Something looks off")
logging.error("Something broke")
No shutdown call required — logs are flushed automatically when your process exits.
Environment variables
| Variable | Description | Default |
|---|---|---|
LOGOTTO_API_KEY |
Your Logotto API key | — |
LOGOTTO_APP_NAME |
Name shown in the dashboard | unknown-app |
LOGOTTO_DEBUG |
Print debug info to stderr (1 to enable) |
— |
kwargs passed to init() take priority over environment variables.
Advanced
Target a specific logger
By default the root logger is used, capturing everything. To only capture logs from a specific logger and its children:
logotto.init(api_key="...", app_name="...", logger="myapp")
Set a minimum log level
By default, INFO and above are captured. To change this:
import logging
logotto.init(api_key="...", app_name="...", level=logging.WARNING)
Debug mode
Prints batch sizes and failures to stderr — useful when verifying your setup:
logotto.init(api_key="...", app_name="...", debug=True)
# or: export LOGOTTO_DEBUG=1
Multiple services in one process
You can call init() once per service. Each call registers an independent
handler and ships logs under its own app_name:
import logotto
import logging
logotto.init(api_key="...", app_name="auth-service", logger="auth")
logotto.init(api_key="...", app_name="payment-service", logger="payment")
logging.getLogger("auth").info("User logged in")
logging.getLogger("payment").info("Payment processed")
Named loggers don't propagate to the root logger, so the two services don't interfere with each other.
Explicit shutdown
Not required, but available if you need to flush before your process exits on its own (e.g. in a long-running background service):
logotto.shutdown()
Project details
Release history Release notifications | RSS feed
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 logotto-0.1.0.tar.gz.
File metadata
- Download URL: logotto-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
221e7691c59fc07dc5fd34df9e4581d1f0c695bdafd9f5a715391599f9d9d708
|
|
| MD5 |
d129289c0b6b4ef3d7420669d086c623
|
|
| BLAKE2b-256 |
c9e395c41e31970e07193283eff2d4066d63a4291d3fece81faca9c1b4ff5b93
|
File details
Details for the file logotto-0.1.0-py3-none-any.whl.
File metadata
- Download URL: logotto-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7041ff3469f2488f27ee99a32a016eee1923bdd3503acbe93d61a12028e2a6a
|
|
| MD5 |
56a24182aeb2cc3a0c1e55c2b77f371d
|
|
| BLAKE2b-256 |
ad27765bfbf73493462ade9e581797208c135706ce41eee142f1c9af9ff4c76d
|