GithubHelp home page GithubHelp logo

monolog-telegram's Introduction

Telegram handler for Monolog

Installation

$ composer require vladimir-yuldashev/monolog-telegram

Usage

<?php

use Monolog\Logger;
use VladimirYuldashev\Monolog\TelegramHandler;

$telegramToken = '';
$chatId = 1;

$handler = new TelegramHandler(
    Logger::ERROR,
    $telegramToken,
    $chatId
);

$log = new Logger('name');
$log->pushHandler($handler);

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

monolog-telegram's People

Contributors

vyuldashev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

monolog-telegram's Issues

Guzzle options

I vote for timeout parameter to control the Web request timeout. Other options like proxy settings are also important. Can you please add an array of options so that we can pass them to Guzzle?

Problem on call

I have a Telegram Handler that works with other libraries, I add your and I can send message but with error.
I have a logger
I have a Call with message + monolog params array
I have also a monolog processor.

The first message is sent ok i can see it in Telegram; but the call crash.

Error

Return value of VladimirYuldashev\Monolog\TelegramHandler::write() must be an instance of VladimirYuldashev\Monolog\void, none returned

in

vendor/vladimir-yuldashev/monolog-telegram/src/Monolog/TelegramHandler.php

Trace

Trace
#0 vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): VladimirYuldashev\Monolog\TelegramHandler->write(Array)
#1 vendor/monolog/monolog/src/Monolog/Logger.php(337): Monolog\Handler\AbstractProcessingHandler->handle(Array)
#2 vendor/monolog/monolog/src/Monolog/Logger.php(368): Monolog\Logger->addRecord(200, 'Params', Array)
#3 index.php(97): Monolog\Logger->addInfo('Params', Array)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.