webCOMAND

io_comand_log\event

Used to represent an event in an event log.

Properties

  • Timestamp - The time the event occurred represented as an integer with the number of seconds since epoch, as returned by PHP time() (aka Unix time).
  • Type - The type of event.
  • Message - String of text that represents the main information about this event.
  • Children - Array of zero or more additional events subordinate to this event.
  • Extra - Variable containing additional information.  No specific type of format is required and it is up to the code interpreting this event to know how to use it.

Example

$repo = comand::repo();

$repo->SystemLog->log_notice("This will log a NOTE event.");

$events = $repo->SystemLog->get_events();
$event = $events[0];
$event_type = \io_comand_log\event\type::get_title($event->Type);

echo($event->Timestamp . ' ' . $event->Type . ': ' . $event->Message);