Thanks for the recommendation, but Phalcon is a highly decoupled framework and our Logging component is not a dependency of other components, you can use Monolog or any other component for logging without problem,
For example, to log the database queries sent to the database server using Monolog:
$eventsManager = new Phalcon\Events\Manager();
$log = new Monolog\Logger('name');
$log->pushHandler(new Monolog\Handler\StreamHandler('logs/db.log', Logger::WARNING));
//Listen all the database events
$eventsManager->attach('db', function($event, $connection) use ($log) {
if ($event->getType() == 'beforeQuery') {
$log->addDebug($connection->getSQLStatement());
}
});
//Assign the eventsManager to the db adapter instance
$connection->setEventsManager($eventsManager);
//Execute some SQL statement
$connection->insert(
"products",
array("Hot pepper", 3.50),
array("name", "price")
);