Skip to content

Log system

Agbarrachina edited this page Mar 20, 2014 · 2 revisions

The shared part

Every log has this requirements:

  • Be define in conf/log.conf. In the way
$config[THE_LOG::LOGGER_NAME] = array();
$config[THE_LOG::LOGGER_NAME]['logger_params'] = array();
$config[THE_LOG::LOGGER_NAME]['logger_params']['priority'] = 2;
$config[THE_LOG::LOGGER_NAME]['logger_params']['backtrace'] = 3;
$config[THE_LOG::LOGGER_NAME]['layout_params'] = array();
$config[THE_LOG::LOGGER_NAME]['layout_params']['type'] = 'simple';
$config[THE_LOG::LOGGER_NAME]['layout_params']['template'] = '%p: [%d %t] %m - %fn (in %f:%l)';
$config[THE_LOG::LOGGER_NAME]['appender_params'] = array();
$config[THE_LOG::LOGGER_NAME]['appender_params']['type'] = 'rollingfile';
$config[THE_LOG::LOGGER_NAME]['appender_params']['layout'] = null;	// Stablished automatically in Log::setUp()
$config[THE_LOG::LOGGER_NAME]['appender_params']['file'] = XIMDEX_ROOT_PATH . '/logs/actions.log';
$config[THE_LOG::LOGGER_NAME]['appender_params']['append'] = true;
$config[THE_LOG::LOGGER_NAME]['getter_params'] = array();
$config[THE_LOG::LOGGER_NAME]['getter_params']['quantity'] = 5000;
$config[THE_LOG::LOGGER_NAME]['getter_params']['file'] = &$config[Action_log::LOGGER_NAME]['appender_params']['file'];

Where THE_LOG is the name of the log class.

  • To have a class in inc/log/. This class must implement the method:
  • debug($msg). Priority level 1
  • info ($msg). Priority level 2
  • warning ($msg). Priority level 3
  • error ($msg). Priority level 4
  • fatal ($msg). Priority level 5

Existent logs in Ximdex CMS.

  • Action_log. Log every called action and the result status.

Topics

  • Home
  • How do I start?
  • Easy Recipes
Clone this wiki locally