Prestashop Logger :: addLog()在哪里保存日志文件?

时间:2013-04-21 10:01:57

标签: logging module prestashop

我在Prestashop模块中遇到以下行:

Logger::addLog('2: md5 string is '.$md5HashData, 1);

日志保存在哪里?

1 个答案:

答案 0 :(得分:12)

日志保存在'log'表中的数据库中(带有您当前的前缀);

您可以从classes/Logger.php

找到addLogg函数

但是没有文档可以从方法评论中找到有用的东西

    /**
* add a log item to the database and send a mail if configured for this $severity
*
* @param string $message the log message
* @param int $severity
* @param int $error_code
* @param string $object_type
* @param int $object_id
* @param boolean $allow_duplicate if set to true, can log several time the same information (not recommended)
* @return boolean true if succeed
*/
public static function addLog($message, $severity = 1, $error_code = null, $object_type = null, $object_id = null, $allow_duplicate = false)

我从代码中了解到,如果第二个参数小于5(来自'configuration'表的PS_LOGS_BY_EMAIL的值),您还应该收到带有警报消息的电子邮件。但它只会被发送和记录一次(如果该方法的最后一个参数$ allow_duplicate不正确)

注意:这在Prestashop 1.6中已更改,该类现在称为PrestaShopLogger,而是使用PrestaShopLogger::addLog($message, $severity);