Skip to content

Logging of any PHQL statement #15403

Answered by borisdelev
wurst-hans asked this question in Q&A
Discussion options

You must be logged in to vote

Well... i will share my db connection service and you can try to use parts u need. All queries are logged.

/**
 * Database connection is created based in the parameters defined in the configuration file
 */
$di->set('db', function () use ($config) {
    $connection = new \Phalcon\Db\Adapter\Pdo\Mysql([
        'host'      => \Config::system()->database->host,
        'username'  => \Config::system()->database->username,
        'password'  => \Config::system()->database->password,
        'dbname'    => \Config::system()->database->name,
        'charset'   => \Config::system()->database->charset,
        'options'   => [
            Pdo::MYSQL_ATTR_INIT_COMMAND => "SET NAMES " . \Config::s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wurst-hans
Comment options

Answer selected by wurst-hans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants