A unified logging client that ships logs to Elasticsearch with async buffering.
Project description
Logship – Python Logging Client for Elasticsearch
Logship 是一个轻量级、可扩展的 Python 日志上报客户端,用于将结构化日志批量、异步推送到 Elasticsearch。
Features
- 异步发送
- 批量缓冲
- 自动重试
- 支持 Basic Auth
- 自动创建索引(可选)
- 最小依赖
Installation
pip install logship-client
Quick Start
from logship import LogshipClient
client = LogshipClient(
base_url="https://your-es-server.com",
index_prefix="logship",
username="elastic",
password="your_password",
app_name="order-service",
env="prod",
)
client.info("用户登录成功", user_id=123)
Advanced Usage
client.debug("查询订单", order_id=9981, cost_ms=12)
client.error("订单支付失败", order_id=9981, code="PAY_TIMEOUT")
Directory Structure
logship/
├── es_logger
│ ├── __init__.py
│ ├── config.py
│ ├── handler.py
│ └── setup.py
├── README.md
├── pyproject.toml
└── LICENSE
License
MIT License
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
logship_client-0.1.1.tar.gz
(5.2 kB
view details)
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 logship_client-0.1.1.tar.gz.
File metadata
- Download URL: logship_client-0.1.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9b18df49a9879c729ac676f6412de671ece9603e93ca00fe91f24a708ff2573
|
|
| MD5 |
a04a866f5e2ce8881ad4ebd4ac792565
|
|
| BLAKE2b-256 |
8d8910ede66e8dd319f01373d7e8c811ca99e8d96509f49640d57cd8fa0fd13b
|
File details
Details for the file logship_client-0.1.1-py3-none-any.whl.
File metadata
- Download URL: logship_client-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
578cbf016fd3a507770340f844b7c40bed848e28dbfafb97d787c1d5e8158ae7
|
|
| MD5 |
fb69ceba3ead50a5071ef2ee388af03b
|
|
| BLAKE2b-256 |
a521cf4d7699f6acc8bbbdc85906ecf3620cc229f665a026fd882c8c5563490d
|