【问题标题】:Where does Prestashop Logger::addLog() save the log file?Prestashop Logger::addLog() 在哪里保存日志文件?
【发布时间】:2013-04-14 08:16:12
【问题描述】:

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

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

日志保存在哪里?

【问题讨论】:

标签: logging module prestashop


【解决方案1】:

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

你可以从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(“配置”表中 PS_LOGS_BY_EMAIL 的值),您还应该收到带有警报消息的电子邮件。但它只会被发送和记录一次(如果方法的最后一个参数 $allow_duplicate 不为真)

注意:这在 Prestashop 1.6 中有所改变,该类现在称为 PrestaShopLogger,请改用 PrestaShopLogger::addLog($message, $severity);。它们显示在后台的Advanced Settings > Logs 下。

【讨论】:

  • 是的,它在数据库中。谢谢!
猜你喜欢
  • 2014-03-19
  • 1970-01-01
  • 2011-08-19
  • 2011-02-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多