bhavik / monolog-mysql
This package is abandoned and no longer maintained.
The author suggests using the bhavitk/monolog-mysql package instead.
Mysql handler for monolog
v1.0.2
2019-05-07 18:24 UTC
Requires
- monolog/monolog: ^1.18
This package is auto-updated.
Last update: 2020-08-09 21:55:01 UTC
README
Monolog handler to log in mysql ldatabase
How to install
Use below code to install via composer
composer require bhavik/monolog-mysql
How to use
First create monolog logger instance as you always do
$log = new Monolog\Logger('channel_name');
Create instance of handler as shown below
$handler = new MonologHandler\MySQLHandler($db, 'logs');
Where $db can be instance of any of these
- PDO
- MySQLi
- Doctrine DBAL
Now push handler with the help of logger instance.
$log->pushHandler($handler);
Last Point
Use Logger as you always do.