Re: PEAR::Log & mdb2
| From: | brian | Date: | Sat, 20 Oct 2007 19:11:18 +0000 |
| Subject: | Re: PEAR::Log & mdb2 | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-28106@lists.php.net to get a copy of this message | ||
Irimia, Suleapa wrote:
Hello,
Can someone tell me what is wrong here please?
-- define('BASE_PEAR_DSN','mysql://root:pass@localhost/db');
if(is_includeable('Log.php')) {
require_once('Log.php');
$logConfig = array('dsn' => BASE_PEAR_DSN);
$logger = &Log::singleton('mdb2', 'log_table', 'System', $logConfig);
if (PEAR::isError($logger)) {
die($logger->getMessage());
}
$logger->log('logging an event' . PEAR_LOG_DEBUG);
}
--
I can't see anything in log_table and i don't know what is wrong here.
Many thanks,
For sanity checking, you should add this, just to make sure you're getting past that hump:
if (is_includeable('Log.php')) {
...
} else {
echo 'cannot include Log.php';
}