ozhowdoo / howdoo-monolog-handler
There is no license information available for the latest version (1.0.2) of this package.
Monolog Formatter and Handler for Howdoo
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Package info
github.com/ozhowdoo/howdoo-monolog-handler
pkg:composer/ozhowdoo/howdoo-monolog-handler
1.0.2
2021-01-16 19:30 UTC
Requires
- php: ^7.2
- ext-json: *
- monolog/monolog: ^1.12|^2.0
Requires (Dev)
- phpunit/phpunit: ^6.5.7
This package is auto-updated.
Last update: 2021-03-07 10:39:53 UTC
README
Monolog Formatter based on NormalizerFormatter for storing logs to the JSON-files.
Install
Update the composer.json file by amend repositories as follows:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/ozhowdoo/howdoo-monolog-handler"
}
]
}
Run the composer installer:
php composer.phar require ozhowdoo/howdoo-monolog-handler:^1.0
Usage
use Monolog\Logger; use Howdoo\Monolog\Handler\LogFileHandler; use Howdoo\Monolog\Formatter\LogFileFormatter; // create a log channel $logger = new Logger('name'); $logLevel = Logger::ALERT; $handler = new LogFileHandler('name', '/path/to/your/logs/directory', $logLevel); $handler->setFormatter(new LogFileFormatter()); $logger->pushHandler($handler); // add records to the log // $log->warning('Foo'); // $log->error('Bar');