PHP code example of noxdk / monolog-journal-handler
1. Go to this page and download the library: Download noxdk/monolog-journal-handler 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/ */
noxdk / monolog-journal-handler example snippets
Monolog\Logger;
use Noxdk\MonologJournalHandler\JournalHandler;
$log = new Logger('MyLogger', [new JournalHandler()]);
$log->info('This is logged to the journal');
$log->info("This is logged to the journal\nand contains multiple\nlines");
$log->info('This is logged to the journal with custom tag', [
'MY_TAG' => 'MyTag',
'ANOTHER_TAG' => "With\nnewlines"
]);