Logoo
A log ingestion engine for openobserve
Pronounced log-ew
pip install logoo
Examples
Primary file. One instance of PrimaryLogger is required per program.
import asyncio
from logoo import PrimaryLogger
async def main():
logger: PrimaryLogger = PrimaryLogger(
__name__,
base_url="",
org="",
stream="",
username="",
password="",
poll_time=5,
)
await logger.start_consumer()
logger.info("Hello world!")
logger.critical("Something went wrong!")
await asyncio.sleep(10)
asyncio.run(main())
Any other file:
from logoo import Logger
logger = Logger(__name__)
logger.info("This comes from another file.")
Note that this supports argument interpolation and can be a fairly good drop in logging replacement:
from logging import Logger as built_in_logger
from logoo import Logger
log = built_in_logger(__name__)
logger = Logger(__name__)
log.info("%s", "Test")
logger.info("%s", "test")
Documentation is as follows and remarkably simple:
Parameters
----------
name: str
The name of the logger
base_url: str
Your base openobserve URL.
E.g. `base_url="https://logs.example.com"`
org: str
The org to make logs under
stream: str
The stream for these logs to be ingested under
username: str
The username to use for auth
password: str
The password to use for auth
logs_per_call: int
How many logs to send per request to your instance.
Useful to set, so you don't hit things like WAF request
limits in high throughput environments.
Note logoo makes as many requests as required
to exhaust the queue every `poll_time`.
Defaults to `100`.
poll_time: datetime.timedelta | float
How often to send all logs to your instance.
Defaults to every `30` seconds.
extra_metadata: dict
Extra metadata to add to all logs made by this class
global_metadata: dict
Extra metadata to add to every log sent to your instance
Support
Want realtime help? Join the discord here.
License
This project is licensed under the MIT license
Metadata
Release files for logoo 1.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| logoo-1.6.0.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| logoo-1.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.1 kB
Release files / logoo-1.6.0.tar.gz
| Download URL | logoo-1.6.0.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82a7a5ad83edb86f2b634cc7590d047df39a9ae32633dc1f054eb5827455a543
|
|
BLAKE2b-256 checksum How to use checksums |
889f3261f7d07dc77dcba7ea8437ca5e20dace348abb8a0eebfe8762f2c87593
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.12
|
Release files / logoo-1.6.0-py3-none-any.whl
| Download URL | logoo-1.6.0-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99190de17a781a1f0890664920e5d82389783b4a56afa16348cc1ace2278c7b5
|
|
BLAKE2b-256 checksum How to use checksums |
7b61b1e1541da1a113c5295d15a862c012a01c63bbf3c30c41f2d701e8723c3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.12
|