Loading Log events from the database
For example, let's load the last fifty LogEvent objects from the Log database, using what we learned in the Item lists section of the Items guide:
$logEvents = new \Cherrycake\Log\LogEvents([
"p" => [
"limit" => 50
]
]);
foreach ($logEvents as $logEvent) {
echo
"[".$e->Locale->formatTimestamp($logEvent->dateAdded, ["isHours" => true, "isSeconds" => true])."] ".
$logEvent->type.
"\n";
}
The LogEvents class accepts some additional keys on top of the usual Items::fillFromParameters keys:
[5/26/20 11:22.24] CherrycakeApp\LogEventMovieSearch
[5/26/20 10:55.28] CherrycakeApp\LogEventMovieSearch
[5/26/20 10:55.25] CherrycakeApp\LogEventMovieSearch
Last modified 1yr ago