Jet\Logger_Interface

This interface defines the backend of logger.

Method Meaning of
public log(
string $event_class,
string $event,
string $event_message,
string $context_object_id = '',
string $context_object_name = '',
mixed $context_object_data = [],
Auth_User_Interface|bool $current_user = false
)
Logs (i.e. actually saves the record) of events.
Parameters:
  • $event_class
    Class/type of event.
  • $event
    Event identifier. This is a text constant that uniquely identifies the event.
  • $event_message
    Text description of the event - readable for the user. Can/should include event details (e.g. 'User XXXX (id:123) has logged out')
  • $context_object_id
    The ID of the object to which the event applies. For example, if the event is editing an article, this parameter should have the value of the ID of the edited article.
  • $context_object_name
    The user-readable name of the object to which the event applies. For example, when editing an article, this parameter can have the value of the article title and so on.
  • $context_object_data
    Arbitrary event context data. As an example, let's take again the editing of an article. It can be an instance of the article and the log will record its form after editing. For example, it can also create an edit history and so on.
  • $current_user
    If a valid user is logged in at the time of the event, then the logger is passed the user instance. Otherwise, the value false is passed.
Previous chapter
Logger - Jet\Logger
Next chapter
Navigation