Log

Contents...

The framework utilizes a common user actions logging mechanism. For example, the system log can be used for statistical analysis of user actions.

Information about user actions is saved in table wa_log, which is common for applications. Below are listed the table fields and the types of values they contain:

How to enable logging:

  1. Declare the actions which must be logged in your applications. To do so, create configuration file wa-apps/{APP_ID}/lib/config/logs.php and specify the identifiers of the desired actions in it; e.g.:

    <?php
    
    return array(
        'contact_add' => array(),
        'contact_edit' => array(),
        'contact_delete' => array(),
        'contact_merge' => array(),
        'form_signup' => array()
    );
    
  2. Call the logging method in the PHP code of controllers and actions as shown below:

    $this->log($action_name, $count);

Example:

<?php

class StickiesStickyActions extends stickiesJsonActionsController
{

    ...
    protected function addAction()
    {
        ...
        $this->log('sticky_add', 1);
        ...
    }
    ...

}