For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > October 2007 > Re: [PEAR] PEAR::Log & mdb2









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] PEAR::Log & mdb2
brian

2007-10-20, 7:04 pm



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';
}
Irimia, Suleapa

2007-10-20, 7:04 pm

brian wrote:
>
>
> Irimia, Suleapa wrote:
>
>
> 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';
> }
>

Hello,

It seems that is working if i choose to display it and not to store it
in db ...

--
$logger = &Log::singleton('display', 'log_table', 'System', $logConfig);
--

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com