I have two logger, one for app, the other for db profiler the app.log works fine. but the db.log records nothing when requests end. The difference is kind of : foreach( $dbConfig, $schema => $config) { $di->set('db_'.$schema, function() use ($di, $schema, $config)) { $conn = new xxxxx; $evtMgr = $di->getShared('eventsManager'); $evtMgr->attach('db'.$schema, new dbListener()); $conn->setEventsManager($evtMgr); return $conn; } }
In class dbListener there is a function afterQuery($event, $conn) writing the log for db statement. The problem is, the model works fine with splited table and db, but it seems the listener's callback has never been called. Is there anyone meets the same problem here?