Mik*_*ika 7 logging module prestashop
我在Prestashop模块中遇到了以下行:
Logger::addLog('2: md5 string is '.$md5HashData, 1);
Run Code Online (Sandbox Code Playgroud)
日志保存在哪里?
Ser*_*Guk 13
日志保存在'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)
Run Code Online (Sandbox Code Playgroud)
据我所知,如果第二个参数小于5(来自'configuration'表的PS_LOGS_BY_EMAIL的值),您还应该收到带有警报消息的电子邮件.但它只会被发送和记录一次(如果该方法的最后一个参数$ allow_duplicate不正确)
注意:这在Prestashop 1.6中已经改变,现在调用该类PrestaShopLogger,PrestaShopLogger::addLog($message, $severity);而是使用.