[GH-ISSUE #102] Can i use mysql to log monolog messages #31

Closed
opened 2026-03-04 02:11:31 +03:00 by kerem · 4 comments
Owner

Originally created by @ghost on GitHub (Aug 13, 2012).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/102

Is there any way that i can use Monolog to send log messages to mysql database for reporting purposes.
I wantt o see whats happening on my site

Originally created by @ghost on GitHub (Aug 13, 2012). Original GitHub issue: https://github.com/Seldaek/monolog/issues/102 Is there any way that i can use Monolog to send log messages to mysql database for reporting purposes. I wantt o see whats happening on my site
kerem closed this issue 2026-03-04 02:11:32 +03:00
Author
Owner

@stloyd commented on GitHub (Aug 13, 2012):

This is why you SHOULD read docs first, before asking about something: https://github.com/Seldaek/monolog/blob/master/doc/extending.md

<!-- gh-comment-id:7684525 --> @stloyd commented on GitHub (Aug 13, 2012): This is why you SHOULD read docs first, before asking about something: https://github.com/Seldaek/monolog/blob/master/doc/extending.md
Author
Owner

@ghost commented on GitHub (Aug 13, 2012):

I am trying as you have written . This was in my index controller

$logger->pushHandler(new LogHandler(new PDO("mysql:host=$host;dbname=$dbname", $user, $pass)));
$logger->addInfo('My logger is now ready');

But no database table is being generated. DO i need to add anything in config.yml file. Because you have not written anything more in your above pointed tutorial

<!-- gh-comment-id:7685426 --> @ghost commented on GitHub (Aug 13, 2012): I am trying as you have written . This was in my index controller $logger->pushHandler(new LogHandler(new PDO("mysql:host=$host;dbname=$dbname", $user, $pass))); $logger->addInfo('My logger is now ready'); But no database table is being generated. DO i need to add anything in config.yml file. Because you have not written anything more in your above pointed tutorial
Author
Owner

@waza-ari commented on GitHub (Feb 17, 2015):

I know this issue is quite old, however it is listed quite on top of Google searches when looking for a MySQL handler for Monolog. I have implemented such a handler, it is available under the MIT license at GitHub (https://github.com/waza-ari/monolog-mysql) or through Composer (https://packagist.org/packages/wazaari/monolog-mysql).

<!-- gh-comment-id:74643465 --> @waza-ari commented on GitHub (Feb 17, 2015): I know this issue is quite old, however it is listed quite on top of Google searches when looking for a MySQL handler for Monolog. I have implemented such a handler, it is available under the MIT license at GitHub (https://github.com/waza-ari/monolog-mysql) or through Composer (https://packagist.org/packages/wazaari/monolog-mysql).
Author
Owner

@deondazy commented on GitHub (Apr 4, 2016):

Thank You @waza-ari

<!-- gh-comment-id:205098579 --> @deondazy commented on GitHub (Apr 4, 2016): Thank You @waza-ari
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#31
No description provided.