Skip to main content

Openobserve log ingestion made simple.

Project description

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

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

logoo-1.5.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

logoo-1.5.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file logoo-1.5.1.tar.gz.

File metadata

  • Download URL: logoo-1.5.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for logoo-1.5.1.tar.gz
Algorithm Hash digest
SHA256 25b989f583764455bb5922dbd46626084a8765c80429d9907a95e5d4ba83d34b
MD5 c7edca579a5312611c93834f45eaf8ec
BLAKE2b-256 69e0a770f6aa78ef626fde200b9cdd5518916e7af6fb88c7baab3fa0ee133090

See more details on using hashes here.

File details

Details for the file logoo-1.5.1-py3-none-any.whl.

File metadata

  • Download URL: logoo-1.5.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for logoo-1.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d7377d6a8a5bdaff95182605cc1d6dd5597908f76fd26b6bc7a9ab5134877a0
MD5 49de22082937151c15d0883889a66b7d
BLAKE2b-256 1d79c5ab321dddadab536e7923ff30b3bd17e2917195a2d8189cfcfafc7384c8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page