PHP code example of efureev / loogger-driver-php

1. Go to this page and download the library: Download efureev/loogger-driver-php 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/ */

    

efureev / loogger-driver-php example snippets


$looggerConfig = new Config($looggerConfigJson);
$loogger = new Loogger($looggerConfig);

$loogger->send($msg);
// ...
$loogger
    ->pattern("<b>Gitlab</b>: {{MSG}}")
    ->sendHTML("<i>Hello from service</i>");

$loogger
->asPlain() // send message as plain
// ->send('Text')
->asHTML() // send message as HTML
// ->send('<b>Bold</b> <pre>code</pre>')
->asMD() // send message as Markdown.
// ->send('*Bold* text')
shell
php send2loogger.php --msg='Testing message!'