bhavik / monolog-mysql
Mysql handler for monolog
Installs: 1 373
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 2
Open Issues: 0
Type:package
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.