PHP code example of danik1604 / monolog-telegram

1. Go to this page and download the library: Download danik1604/monolog-telegram library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

danik1604 / monolog-telegram example snippets




use \MonologTelegram\Log;

define("TELEGRAM_BOT_TOKEN", "");
define("TELEGRAM_CHAT_ID", "");

$log = new Log("TITLE GOES HERE");

$data = ['example' => 'data'];
$log->info("Message", $data);



use \MonologTelegram\Log;

define("TELEGRAM_BOT_TOKEN", "");
define("TELEGRAM_CHAT_ID", "");

$log = new Log("TITLE GOES HERE");

$log->notice("Message", []);  // ⚪
$log->critical("Message", []); // 🔴
$log->alert("Message", []); // 🔵
$log->info("Message", []); // 🟢
$log->error("Message", []); // 🟠
$log->warning("Message", []); // 🟡