getLogger( ) suddenly empty & solution

7 views
Skip to first unread message

Marcello H

unread,
Mar 29, 2016, 4:49:51 AM3/29/16
to redbeanphp
Normally I have logging information, but today it stopped and giving me an error (that it's null)

R::setup('mysql:host=' . $options['host'] . ';dbname=' . $options['dbname'], $options['user'], $options['pass'], $options['frozen']);
R::setAutoResolve(TRUE);
R::debug( TRUE, 3 );

then later in my code:

$db = R::getDatabaseAdapter();
if ($db)
{
  $logs = $db->getDatabase()->getLogger();
  $logDump = implode("<BR>",$logs->getLogs());
}

but the $logs is null
and  I can't figure out why. The code was working yesterday and nothing changed.

I read that I can do this:

R::getDatabaseAdapter()->getDatabase()->setLogger( new RDefault );
and that gave me some more info.

I found out my database was completely missing.
(which seems strange, but somehow my sync environment with different hardware messed up)

Anyways, for others who have the same problems...



Reply all
Reply to author
Forward
0 new messages