1. Go to this page and download the library: Download pollen-solutions/log 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/ */
pollen-solutions / log example snippets
use Pollen\Log\LogManager;
$log = new LogManager();
// Adds a log record at the DEBUG level
$log->debug('My debug message');
// Adds a log record at the INFO level
$log->debug('My info message');
// Adds a log record at the SUCCESS level
$log->success('My success message');
// Adds a log record at the NOTICE level
$log->notice('My notice message');
// Adds a log record at the WARNING level
$log->warning('My warning message');
// Adds a log record at the ERROR level
$log->error('My error message');
// Adds a log record at the CRITICAL level
$log->critical('My critical message');
// Adds a log record at the ALERT level
$log->alert('My alert message');
// Adds a log record at the EMERGENCY level
$log->emergency('My alert message');
use Pollen\Log\LogManager;
$log = (new LogManager())->setDefaultStoragePath('/var/log/myapp');
use Monolog\Handler\NativeMailerHandler;
use Pollen\Log\Logger;
use Pollen\Log\LogManager;
$log = new LogManager();
$channel = new Logger(
'mailer',
[new NativeMailerHandler('[email protected]', 'You have a log report message !', '[email protected]')]
);
$log->addChannel($channel);
$log->channel('mailer')->error('Test log error message');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.