Loading Log events from the database
Since the LogEvent class extends the Item class, and the LogEvents class extends the Items class, you can use them to load lists of LogEvent objects from the database to work with.
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:
The LogEvents class accepts some additional keys on top of the usual Items::fillFromParameters keys:
type
Retrieves only LogEvent objects of this class name. Must include the full namespace route to the class.fromTimestamp
Retrieves LogEvent objects triggered after this timestamp.toTimestamp
Retrieves LogEvent objects triggered up to this timestamp.
See this example working in the Cherrycake documentation examples site.
Last updated