| Name | LogVictoriaLogs JSON |
| Version |
0.1.1
JSON |
| download |
| home_page | https://github.com/yourusername/LogVictoriaLogs |
| Summary | Python client for VictoriaLogs integration |
| upload_time | 2025-11-04 03:33:50 |
| maintainer | None |
| docs_url | None |
| author | Author |
| requires_python | >=3.7 |
| license | MIT License
Copyright (c) 2025 LogVictoriaLogs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# LogVictoriaLogs
Python client library for integrating with VictoriaLogs, a high-performance log database and search solution.
## Features
- Easy integration with VictoriaLogs
- Support for multiple logging protocols (HTTP, Syslog)
- Automatic caller information capture
- Python logging module integration
- Structured logging with rich context information
## Installation
```bash
pip install LogVictoriaLogs
```
## Usage
### Basic Usage
```python
# ----------------------------------------------------------------------
# 🎯 示例
# ----------------------------------------------------------------------
def demo_function():
# 初始化主客户端,只包含基础配置
base_client = VictoriaLogsClient("192.168.164.31", project="shortlink-system")
# 创建服务特定的客户端
service_client = base_client.create_client("shortlink-updater")
service_client.sent("从 demo_function 发出的日志")
if __name__ == "__main__":
# 初始化主客户端,只包含基础配置
base_client = VictoriaLogsClient("192.168.164.31", project="shortlink-system")
# 为不同服务创建子客户端
main_client = base_client.create_client("main")
updater_client = base_client.create_client("shortlink-updater")
# 模拟模块日志
demo_function()
main_client.sent("主模块启动完成")
updater_client.sent("短链更新成功")
# 查询
main_client.print_logs('project:"shortlink-system" service:"shortlink-updater"')
```
### Python Logging Integration
```python
import logging
from LogVictoriaLogs import VictoriaLogsClient
# Create client
client = VictoriaLogsClient("victorialogs-host", 9428, 514)
# Configure logging
logger = logging.getLogger("MyApp")
logger.setLevel(logging.INFO)
# Add VictoriaLogs handler
handler = client.setup_logging_handler(service="my-application")
logger.addHandler(handler)
# Use standard logging
logger.info("Application started")
logger.error("Something went wrong")
```
## License
MIT
Raw data
{
"_id": null,
"home_page": "https://github.com/yourusername/LogVictoriaLogs",
"name": "LogVictoriaLogs",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Author",
"author_email": "Author <author@example.com>",
"download_url": "https://files.pythonhosted.org/packages/fd/d7/bf73aa4bd73b5438ce8df7a6919e8c077261d880488fe98394cdf99266e6/logvictorialogs-0.1.1.tar.gz",
"platform": null,
"description": "# LogVictoriaLogs\r\n\r\nPython client library for integrating with VictoriaLogs, a high-performance log database and search solution.\r\n\r\n## Features\r\n\r\n- Easy integration with VictoriaLogs\r\n- Support for multiple logging protocols (HTTP, Syslog)\r\n- Automatic caller information capture\r\n- Python logging module integration\r\n- Structured logging with rich context information\r\n\r\n## Installation\r\n\r\n```bash\r\npip install LogVictoriaLogs\r\n```\r\n\r\n## Usage\r\n\r\n### Basic Usage\r\n\r\n```python\r\n# ----------------------------------------------------------------------\r\n# \ud83c\udfaf \u793a\u4f8b\r\n# ----------------------------------------------------------------------\r\ndef demo_function():\r\n # \u521d\u59cb\u5316\u4e3b\u5ba2\u6237\u7aef\uff0c\u53ea\u5305\u542b\u57fa\u7840\u914d\u7f6e\r\n base_client = VictoriaLogsClient(\"192.168.164.31\", project=\"shortlink-system\")\r\n # \u521b\u5efa\u670d\u52a1\u7279\u5b9a\u7684\u5ba2\u6237\u7aef\r\n service_client = base_client.create_client(\"shortlink-updater\")\r\n service_client.sent(\"\u4ece demo_function \u53d1\u51fa\u7684\u65e5\u5fd7\")\r\n\r\n\r\nif __name__ == \"__main__\":\r\n # \u521d\u59cb\u5316\u4e3b\u5ba2\u6237\u7aef\uff0c\u53ea\u5305\u542b\u57fa\u7840\u914d\u7f6e\r\n base_client = VictoriaLogsClient(\"192.168.164.31\", project=\"shortlink-system\")\r\n \r\n # \u4e3a\u4e0d\u540c\u670d\u52a1\u521b\u5efa\u5b50\u5ba2\u6237\u7aef\r\n main_client = base_client.create_client(\"main\")\r\n updater_client = base_client.create_client(\"shortlink-updater\")\r\n\r\n # \u6a21\u62df\u6a21\u5757\u65e5\u5fd7\r\n demo_function()\r\n main_client.sent(\"\u4e3b\u6a21\u5757\u542f\u52a8\u5b8c\u6210\")\r\n updater_client.sent(\"\u77ed\u94fe\u66f4\u65b0\u6210\u529f\")\r\n\r\n # \u67e5\u8be2\r\n main_client.print_logs('project:\"shortlink-system\" service:\"shortlink-updater\"')\r\n\r\n```\r\n\r\n### Python Logging Integration\r\n\r\n```python\r\nimport logging\r\nfrom LogVictoriaLogs import VictoriaLogsClient\r\n\r\n# Create client\r\nclient = VictoriaLogsClient(\"victorialogs-host\", 9428, 514)\r\n\r\n# Configure logging\r\nlogger = logging.getLogger(\"MyApp\")\r\nlogger.setLevel(logging.INFO)\r\n\r\n# Add VictoriaLogs handler\r\nhandler = client.setup_logging_handler(service=\"my-application\")\r\nlogger.addHandler(handler)\r\n\r\n# Use standard logging\r\nlogger.info(\"Application started\")\r\nlogger.error(\"Something went wrong\")\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n",
"bugtrack_url": null,
"license": "MIT License\r\n \r\n Copyright (c) 2025 LogVictoriaLogs\r\n \r\n Permission is hereby granted, free of charge, to any person obtaining a copy\r\n of this software and associated documentation files (the \"Software\"), to deal\r\n in the Software without restriction, including without limitation the rights\r\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n copies of the Software, and to permit persons to whom the Software is\r\n furnished to do so, subject to the following conditions:\r\n \r\n The above copyright notice and this permission notice shall be included in all\r\n copies or substantial portions of the Software.\r\n \r\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n SOFTWARE.",
"summary": "Python client for VictoriaLogs integration",
"version": "0.1.1",
"project_urls": {
"Bug Tracker": "https://github.com/yourusername/LogVictoriaLogs/issues",
"Homepage": "https://github.com/yourusername/LogVictoriaLogs"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d0437235e705c0ce96f4dc08a711a78b18c9ae1a1dc5ac6b85b8d587fae9f435",
"md5": "4e09511a2977d0f6a358c29a71f2a1f7",
"sha256": "0033a1d9f5503018bcbb5a9a733e289a7e2d80b1add0189b7c2aaa3a90a9a237"
},
"downloads": -1,
"filename": "logvictorialogs-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4e09511a2977d0f6a358c29a71f2a1f7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 7676,
"upload_time": "2025-11-04T03:33:49",
"upload_time_iso_8601": "2025-11-04T03:33:49.949258Z",
"url": "https://files.pythonhosted.org/packages/d0/43/7235e705c0ce96f4dc08a711a78b18c9ae1a1dc5ac6b85b8d587fae9f435/logvictorialogs-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "fdd7bf73aa4bd73b5438ce8df7a6919e8c077261d880488fe98394cdf99266e6",
"md5": "92e1c038dfeeac384fb7b11924c1042a",
"sha256": "99e8d1b0ed7bf7734ecce086b52947325fab534e0f4491a65cc6da5ab11e47ed"
},
"downloads": -1,
"filename": "logvictorialogs-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "92e1c038dfeeac384fb7b11924c1042a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6937,
"upload_time": "2025-11-04T03:33:50",
"upload_time_iso_8601": "2025-11-04T03:33:50.985842Z",
"url": "https://files.pythonhosted.org/packages/fd/d7/bf73aa4bd73b5438ce8df7a6919e8c077261d880488fe98394cdf99266e6/logvictorialogs-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-11-04 03:33:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yourusername",
"github_project": "LogVictoriaLogs",
"github_not_found": true,
"lcname": "logvictorialogs"
}