Skip to main content

A log handler for VictoriaLogs.

Project description

victorialogs-handler

A high-performance Python log handler for VictoriaLogs.

release python CI/CD codecov license

[!IMPORTANT] STATUS: In development. The API may still change.

Description

victorialogs-handler is a high-performance Python log handler tailored for VictoriaLogs. It integrates seamlessly with Python’s native logging module, allowing you to stream log events to a VictoriaLogs instance with minimal configuration.

  • Non-blocking: Logs are stored in a buffer and later processed in a background thread.
  • Hybrid trigger: Log processing is triggered by a ticker and/or when a size threshold is reached.
  • Batching: Multiple logs are combined into one request to the log server to minimize the amount of requests.
  • Complete logs: All fields of a log record are transmitted including exceptions and extra fields.
  • Highly customizable: The handler's behavior is highly customizable (see also Documentation)

Installation

The handler can be installed with PIP from PyPI:

pip install victorialogs-handler

Quick start

[!NOTE] The script assumes that there is a VictoriaLogs server running on the same system at the default URL: http://localhost:9428

Here is a quick example on how to use the handler in your Python script:

import logging

from vlogs_handler import VictoriaLogsHandler

# Create a custom logger with INFO level
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

# Add a handler for VictoriaLogs
vlogs_handler = VictoriaLogsHandler()
vlogs_handler.setLevel(logging.DEBUG)
logger.addHandler(vlogs_handler)

# Log example
logger.info("This is an info message")

Please see the directory /examples for additional examples on how to use the handler.

Documentation

The full documentation can be found here: Documentation.

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

victorialogs_handler-0.1.0a1.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

victorialogs_handler-0.1.0a1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file victorialogs_handler-0.1.0a1.tar.gz.

File metadata

  • Download URL: victorialogs_handler-0.1.0a1.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for victorialogs_handler-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 e08ee113f3e32fe1866cac5cf82731a34ab4b3a8eec504af9485f27d4f0605cb
MD5 9ab63a08dc838cb14141d8f8c494c412
BLAKE2b-256 da5df1d2de43c72eebf7a0bdee94182f1f650d17268d3460668a11be54229447

See more details on using hashes here.

File details

Details for the file victorialogs_handler-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for victorialogs_handler-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 7983d63a2edec4e13d68c564a1d865bb70a7e949aca093f75b6212ad57d4d7d3
MD5 70684a9ca81db2bd5831bec82e156e37
BLAKE2b-256 d3ee9ab6f346bee2d4296a948ffd8e1240504373434786b6bc54f7e4796a4c41

See more details on using hashes here.

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