承接 msschl/monolog-http-handler 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

msschl/monolog-http-handler

最新稳定版本:0.1.3

Composer 安装命令:

composer require msschl/monolog-http-handler

包简介

msschl/monolog-http-handler sends log records to a HTTP server.

README 文档

README

Build Status Scrutinizer Code Quality Code Intelligence Status Coverage Status

Monolog Http Handler

This package provides a HttpHandler for the Monolog library.

Prerequisites

  • PHP 7.0 or above.
  • Since this package adds a HttpHandler to the Monolog library, you should first install Monolog.

Installation

Install the latest version with

$ composer require msschl/monolog-http-handler

After the installation

...you need to decide on which HTTP client/adapter you want to use.

HTTP Clients

In order to send HTTP requests, you need a HTTP adapter. This package relies on HTTPlug which is build on top of PSR-7 and defines how HTTP message should be sent and received. You can use any library to send HTTP messages that implements php-http/client-implementation.

Here is a list of all officially supported clients and adapters by HTTPlug: http://docs.php-http.org/en/latest/clients.html

Read more about HTTPlug in their docs.

Basic Usage

<?php

use Monolog\Logger;
use Msschl\Monolog\Handler\HttpHandler;

// create a log channel
$log = new Logger('name');

// push the HttpHandler to the monolog logger.
$log->pushHandler(new HttpHandler([
    'uri'     => 'https://localhost/your/endpoint/for/logging',
    'method'  => 'POST',
]));

// add records to the log
$log->warning('Foo');
$log->error('Bar');

About

Submitting bugs and feature requests

Bugs and feature request are tracked on GitHub

Contributing

First of all, thank you for contributing! In order to make code reviews easier please follow some simple rules listed in the CONTRIBUTING.md file.

License

This project is licensed under the terms of the MIT license. See the LICENSE file for license rights and limitations.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-21