定制 tomas-kulhanek/monolog-loki 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tomas-kulhanek/monolog-loki

Composer 安装命令:

composer require tomas-kulhanek/monolog-loki

包简介

Loki handler for Monolog

README 文档

README

Loki handler for Monolog, providing a formatter that serializes records into the JSON format expected by Grafana Loki.

Latest Version
License

Table of Contents

Installation

Require the package via Composer:

composer require tomas-kulhanek/monolog-loki

Usage

Below is a minimal example showing how to send logs to a Loki server:

use Monolog\Level;
use Monolog\Logger;
use TomasKulhanek\Monolog\Loki\LokiHandler;

$handler = new LokiHandler(
    'http://your-loki-host:3100',
    'username',
    'password',
    ['app'=>'My application', 'env'=>'production'],
    Level::Debug
);

$logger = new Logger('loki');
$logger->pushHandler($handler);

$logger->info('User signed in', ['user_id' => 123]);

Grafana explore

Contributing

Contributions are very welcome! Please:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/YourFeature).
  3. Make your changes, ensuring all tests pass and coding standards are met.
  4. Submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

统计信息

  • 总下载量: 1.85k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固